I have been working on populating a highchart with dynamic data in my angularjs application using the "highcharts-ng" directive.
https://github.com/pablojim/highcharts-ng
The data I am using typically follows this format:
x-axis (categories):
[0, 0.0001001001001, 0.0002002002002, 0.0003003003003,
0.0004004004004, 0.000500500500501, 0.000600600600601]
y-axis:
{
name: value1,
data: [
0, 2.27112321592e-7, 8.69358451877e-7,
0.00000192654087985, 0.00000339761308545,
0.0000052811192715, 0.00000757519580291
]}
The categories can contain a large number of values, and each x-axis category has a corresponding y-axis value.
To dynamically set the x-axis categories, I used the following code: chart.xAxis[0].setCategories(categories);
Other relevant properties that I have set include:
$scope.chartConfig = {
chart: {
type:'spline'
}
options: {
plotOptions: {
series: {
turboThreshold: 51000,
}
}
},
xAxis: {
type: 'category', (I tried with 'linear' as well)
allowDecimals: true,
min: 0,
},
useHighStocks: true
};
Despite these settings, I am still seeing the x-axis values displayed as "datetime" instead of simple decimal values. Is there a way to change this display?
Additionally, since the x-axis values are decimal, is it feasible to show them in scientific notation (e.g., show 0.0003003003003 as 3.003e-04)?
Thank you for any assistance you can provide.
Best regards, Kapil