Giter VIP home page Giter VIP logo

Comments (6)

AzureGulf avatar AzureGulf commented on May 19, 2024

Have just started using your charts today - looks good.
Please add a few simple examples for things like formatting the Y axis labels - I've tried formatting with standard C# strings such as "N0" (to get zero decimal places and comma delimiter) but no luck, so far...
And, is the YValue/Aggregrate always 'decimal', can't I have other value types on the Y axis?

from blazor-apexcharts.

joadan avatar joadan commented on May 19, 2024

The formaters are javascript functions, please see the samples in the Apex documentation, https://apexcharts.com/docs/formatting-axes-labels/

The Line samples Datetime do contains examples of Y value tooltip.

The data type for Y axis is decimal, but you should be able convert a numeric type to it. Please let me know if you have a use case where this is not working.

For zeros decimal places you can use the option DecimalsInFloat, this is also in the Datetime sample

options.Yaxis.Add(new YAxis
            {
                DecimalsInFloat = 0,
                Labels = new AxisLabels { Rotate = -45, Style = new AxisLabelStyle { FontSize = "10px" } },
                Title = new AxisTitle { Text = "Value", Style = new AxisTitleStyle { FontSize = "14px", Color = "lightgrey" } }
            });

from blazor-apexcharts.

AzureGulf avatar AzureGulf commented on May 19, 2024

Thanks for your comment and pointers.
Most Y axes can be formatted to the local culture, so "en-us" would show a (currency) value of 300000.00 as $300,000.00 whereas in "fr" it would be €300 000,00 and so on...

Numeric values should also follow the same formatting rules (for example as defined by the N formatter). I'd also expect numbers to be similarly formatted within the tooltip.

My comment on the Y axis type was simply to question why it was fixed as decimal - what happens if you want to invert the X and Y axes? Say, as per your first Line chart example, so that Y axis is now the Country and X is the value.

from blazor-apexcharts.

joadan avatar joadan commented on May 19, 2024

I agree on the formatters, only having javascript functions is really limiting. I'll raise a separate issue for tracking this.

For the Y decimal value, should not be a problem, if you want to invert the Axis you set up the chart as normal and then flip the axis, see Horizontal demo here https://apexcharts.github.io/Blazor-ApexCharts/bar-charts

from blazor-apexcharts.

AzureGulf avatar AzureGulf commented on May 19, 2024

For the Y decimal value, should not be a problem, if you want to invert the Axis you set up the chart as normal and then flip the axis, see Horizontal demo here https://apexcharts.github.io/Blazor-ApexCharts/bar-charts

thanks - I missed that!

from blazor-apexcharts.

joadan avatar joadan commented on May 19, 2024

Clean up

from blazor-apexcharts.

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.