marco811

formatNumberScale in timeseries chart?

Recommended Posts

Hello

I am trying to implement "formatNumberScale" option in timeseries chart but is not working.

Still showing "k" for thousands.

Thanks

image.png.7a5ce569d47faeb27914e7a796928323.png

Promise.all([
fetch('https://s3.eu-central-1.amazonaws.com/fusion.store/ft/data/line-chart-with-time-axis-data.json'),
fetch('https://s3.eu-central-1.amazonaws.com/fusion.store/ft/schema/line-chart-with-time-axis-schema.json')
]).then(function(res) {
	Promise.all([
		res[0].json(),
		res[1].json()
	]).then(function(res) {
		showChart(res[0], res[1]);
	});
	
});

function showChart(dataFetch, schemaFetch) {

  const dataStore = new FusionCharts.DataStore();
  const dataSource = {
    chart: {
		"formatNumberScale": "0"
	},
    caption: {
      text: "Sales Analysis"
    },
    subcaption: {
      text: "Grocery"
    },
    yaxis: [
      {
        plot: {
          value: "Grocery Sales Value"
        },
        format: {
          prefix: "$"
        },
        title: "Sale Value"
      }
    ]
  };
  dataSource.data = dataStore.createDataTable(dataFetch, schemaFetch);

  new FusionCharts({
    type: "timeseries",
    renderAt: "chart-container",
    width: "100%",
    height: "500",
    dataSource: dataSource
  }).render();
}

 

Share this post


Link to post
Share on other sites

Hi,

You can disable the default formatting of the y-axis values to display the raw data in the chart. To disable the default formatting of the y-axis values, set the value of defaultFormat attribute to 0 under format object.

 

Demo: http://jsfiddle.net/srishti_fc/xn6dzswh/18/

Reference: https://www.fusioncharts.com/dev/fusiontime/fusiontime-component/y-axis-in-fusiontime#automatic-number-formatting

 

Thanks,

Srishti

Share this post


Link to post
Share on other sites
4 hours ago, Srishti Jaiswal said:

Hi,

You can disable the default formatting of the y-axis values to display the raw data in the chart. To disable the default formatting of the y-axis values, set the value of defaultFormat attribute to 0 under format object.

 

Demo: http://jsfiddle.net/srishti_fc/xn6dzswh/18/

Reference: https://www.fusioncharts.com/dev/fusiontime/fusiontime-component/y-axis-in-fusiontime#automatic-number-formatting

 

Thanks,

Srishti

Hi. I have solved the problem. Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now