Highstock:X轴设定为不"日期时间" [英] Highstock: set xAxis as not "datetime"

查看:930
本文介绍了Highstock:X轴设定为不"日期时间"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图来填充一些动态数据highchart我angularjs应用。我使用的是highcharts-NG指令来工作的highcharts。

I am trying to populate a highchart with some dynamic data in my angularjs application. I am using the "highcharts-ng" directive for working the the highcharts.

https://github.com/pablojim/highcharts-ng

的数据是以下格式的通常是:

The data is typically of the following format:

x轴(类别):0,0.0001001001001,0.0002002002002,0.0003003003003,0.0004004004004,0.000500500500501,0.000600600600601]

x-axis (categories): [0, 0.0001001001001, 0.0002002002002, 0.0003003003003, 0.0004004004004, 0.000500500500501, 0.000600600600601]

y轴:
{名称:值1,数据:[0,2.27112321592e-7,8.69358451877e-7,0.00000192654087985,0.00000339761308545,0.0000052811192715,0.00000757519580291]}

y-axis: {name: value1, data: [0, 2.27112321592e-7, 8.69358451877e-7, 0.00000192654087985, 0.00000339761308545, 0.0000052811192715, 0.00000757519580291]}

的类别可包含上千个值,并在x轴类别每一个值,存在一个对应的y轴的值

The categories can contain thousands of values, and for each value in "x-axis category", there is a corresponding y-axis value

我已经设置了x轴类别动态使用以下code:
chart.xAxis [0] .setCategories(类别);

I have set the "x-axis" categories dynamically using the following code: chart.xAxis[0].setCategories(categories);

这是我设置一些其他相关的属性是:

Some other relevant properties that I have set are:

$ scope.chartConfig = {
    图:{
        类型:花键
    }
    选项​​:{
        plotOptions:{
            系列:{
                turboThreshold:51000,
            }
        }
    },
    X轴:{
        类型:'类',(我和线性尝试为好)
        allowDecimals:真实,
        分:0,
    },
    useHighStocks:真
};

$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 };

不过,我仍然看到了x轴是显示的数值为日期时间。有没有什么办法中,我可以使X轴值一个简单的十进制值,而不是为日期时间?

However, I am still seeing that "x-axis" is showing the values as "datetime". Is there any way in which I can make the x-axis value a simple "decimal values" and not as datetime?

此外,由于x轴的数值都是十进制的,是可以显示相应的科学记数法来代替(即,而不是显示0.0003003003003,就可以显示3.003e-04)?

Also, since the x-axis values are decimal values, is it possible to display the corresponding scientific notation instead (i.e. instead of showing 0.0003003003003, can we show 3.003e-04)?

在此先感谢您的帮助。

问候,
卡皮尔

Regards, Kapil

推荐答案

在Highstock仅日期时间轴类型存在。在Highcharts你有线性/日期/对数和分类类型。

In Highstock only datetime axis type exists. In Highcharts you have linear/datetime/logarithmic and categorized types.

参考文献:

  • Highcharts xAxis // type property
  • Highstock xAxis // last element in docs

这篇关于Highstock:X轴设定为不"日期时间"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆