Converting axis labels to Scientific format

Posted by: sachinhegde70 on 14 September 2017, 2:57 am EST

    • Post Options:
    • Link

    Posted 14 September 2017, 2:57 am EST

    How to set axis labels format such that my labels will be in scientific format. Currently all the labels are showing 0.00.

    I am using the following code

    <wj-flex-chart #zoomChart plotMargin=“NaN NaN NaN 80” chartType=“Line” bindingX=“xVal” [itemsSource]=“data”>

    <wj-flex-chart-legend position=“Right”></wj-flex-chart-legend>

    <wj-flex-chart-axis wjProperty=“xAxis” [axisLine]=“false” (rangeChanged)=“rangeChanged()”></wj-flex-chart-axis>

    <wj-flex-chart-axis wjProperty=“yAxis” binding=“close” (rangeChanged)=“rangeChanged()”></wj-flex-chart-axis>

    <wj-flex-chart-series binding=“IInductor” name=“IInductor” axisX=“xAxis” axisY=“yAxis”></wj-flex-chart-series>

    </wj-flex-chart>

  • Posted 14 September 2017, 2:57 am EST

    Hi,

    You can set the format property of the X axis to format the data.

    <wj-flex-chart style="height:250px" items-source="vm.cumulativeDailyData" chart-type="Area" stacking="Stacked" labels="false"
                                    rotated="false" binding-x="field1">
                                        <wj-flex-chart-axis wj-property="axisX" labels="true" axis-line="true" format="n3" major-grid="true"></wj-flex-chart-axis>

    Please refer to the Globalize Class for supported formats.

    Thanks,

    Abhishek

  • Posted 14 September 2017, 2:57 am EST

    The formatNumber method accepts most .NET-style Standard Numeric Format Strings, except for the ‘e’ and ‘x’ formats (scientific notation and hexadecimal) which are not supported.

    So I can’t achieve what i want here?

    I want to use e (scientific notation to my x axis label)

  • Posted 14 September 2017, 2:57 am EST

    Hi,

    This thread has been replied on the following forum thread.

    http://wijmo.com/topic/multiple-y-axis-in-line-chart

    Please refer to the above thread.

    Thanks,

    Manish Kumar Gupta

  • Posted 23 June 2020, 3:36 am EST

    Hi Manish,

    I have a query regarding Flexchart and chartType is “Line” and am using React in my project,

    the chart am using is having 3 y-axes, and the numbers on these axes will range from 0 to 4,000,000 … or even more than that.

    so, here i want to format these large numbers.

    suppose the number on any of these axes is 4,000,000,

    then i want to plot this number on this axes as 4M.

    other numbers like 4000 to 4k… like this kind of format.

    so, is there any way to achieve this?

  • Posted 23 June 2020, 5:28 pm EST

    Hi,

    You can create a function that will convert numbers like 1000 to 1k and use the itemFormatter of Axis class to format the labels. Please refer to the sample link below:

    https://stackblitz.com/edit/react-kpljlt

    Regards,

    Ashwin

  • Posted 4 July 2020, 11:02 pm EST

    Thank you Ashwin, and it is working fine.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels