Giter VIP home page Giter VIP logo

Comments (10)

stsrki avatar stsrki commented on May 15, 2024

I believe the problem is with Ticks property in the axes. The thing is that Blazor have it's own serializer and it is not very good. In this case it will serialize axe as

{
    display: false,
    ticks: null
}

Now ticks: null is the problem because chartjs will try to read that because it is specified. It doesn't matter if it's null, it will still try to read it. It's really stupid behavior :/

I cannot do much in the 0.5.x version because that version is still using Blazor 0.7
Blazorise 0.6 is converted to Blazor 0.8 and it has better compatibility with newtonsoft json so maybe I could use that to omit nullable objects from serializing.

from blazorise.

stsrki avatar stsrki commented on May 15, 2024

As I feared, the built-in serializer is still in use #7346. I can do as Steve has recommended but it just feels dirty. I think that adding third party libraries to Blazorise is not the path I want to go.

@DaleCam What do you think?

from blazorise.

DaleCam avatar DaleCam commented on May 15, 2024

Hi @stsrki thansks for your consideration with this! How about an option then where we can pass you a string (json object) of the options instead of a ChartOption class? That would be ultimately flexible for users, and you then wouldnt need to keep a ChartOptions object up to date. However if users did want to keep using chart options, they could deserialise that to a json string as a user and pass that to your lib as a stringified json object. What do you think?

from blazorise.

stsrki avatar stsrki commented on May 15, 2024

It's not a bad idea and it's pretty easy to implement. But it will definitely be a temporary feature, at least until there is a better serializer implemented in Blazor.

I can add two parameters for charts(data and options), and mark them as Obsolete so that user can know that it will be removed sometime in the future.

Possible names for parameters:

  • DataJsonString
  • OptionsJsonString

from blazorise.

stsrki avatar stsrki commented on May 15, 2024

PS. can you tell what version of Blazorise are you using.
0.5,x(for Blazor 0.7) or 0.6(for Blazor 0.8 preview)?

from blazorise.

DaleCam avatar DaleCam commented on May 15, 2024

PS. can you tell what version of Blazorise are you using.
0.5,x(for Blazor 0.7) or 0.6(for Blazor 0.8 preview)?

0.5.x until i have time to upgrade which may be a while!
Thanks so much!

from blazorise.

stsrki avatar stsrki commented on May 15, 2024

I have added the feature in both version(0.5x and 0.6 preview). Please try it and let me know how it goes.

from blazorise.

DaleCam avatar DaleCam commented on May 15, 2024

Hi @stsrki,
Its working well! Thank you!

from blazorise.

DaleCam avatar DaleCam commented on May 15, 2024

@stsrki Actually is there anyway to turn Gridlines off currently? No biggie, its just a nicety for me:)
https://www.chartjs.org/docs/latest/axes/styling.html#grid-line-configuration
Actually I can use the new string Options for that too!

from blazorise.

stsrki avatar stsrki commented on May 15, 2024

Yes just use string options for now, I will try to add styling options to the new version.
But keep in mind that all new features will be in the v0.6.

from blazorise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.