Converting axis labels to Scientific format

Originally Posted 13 March 2017, 9:13 pm EST

  • Originally Posted 13 March 2017, 9:13 pm 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>
  • Reply


    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.

  • Reply

    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)
  • Reply

    This thread has been replied on the following forum thread.

    Please refer to the above thread.

    Manish Kumar Gupta
  • Reply

    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?

  • Reply


    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:

  • Reply

    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