我正在使用打开的 Flash 图表在我的页面中显示图表。我正在使用下面的代码将折线图数据显示到我的页面。
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "530", "250","9.0.0", "expressInstall.swf",
{"data-file":"data.json"}
);
</script>
我的json文件如下
{
"y_legend":{
"text": "Price US$",
"style": "{color: #53B9AA;font-size:20; }"
},
"elements":[
{
"type": "line",
"colour": "#53B9AA",
"bg_colour": "#E58A25",
"background-color":"#53B9AA",
"inner_background": "#E58A25",
"text": "Price History",
"font-size": 19,
"width": 1,
"dot-style": {
"type":"solid-dot", "colour":"#F57F22", "dot-size": 3,
"tip":"Average price: #val#<br>#x_label#" },
"on-show": {"type": "shrink-in", "cascade":1, "delay":0.7},
"values" : [
5,7,10,12,13,{"value":11,"colour":"#53B9AA","tip":"Average price : #val#<br>#x_label#"},
10,9,8,7,6]
}
],
"x_axis":{
"colour": "#7CC8B5",
"text": "Price US$",
"labels": {
"rotate": "vertical",
"labels":["Jan-09","Feb-09","Mar-09",
"Apr-09","May-09","Jun-09",
"Jul-09","Aug-09","Sep-09",
"Oct-09","Nov-09","Dec-09",
"Jan-10","Feb-10","Mar-10"]
}
},
"y_axis":{
"stroke": 4,
"tick-length": 10,
"colour": "#7CC8B5",
"grid-colour": "#ADB5C7",
"grid-visible": true,
"offset": false,
"min": 5,
"max": 20,
"visible": true,
"steps": 5
}
}
该图表在我的浏览器中呈现得很好。现在我想向图表添加更多数据。基本上我的图表显示过去几个月的平均销售额。我也想显示预计/预测/未来数据。我可以通过该数据到 jSON 文件。我希望未来的数据在图表中以不同的颜色显示。我也想在图表顶部显示图例,以指示哪个是当前数据,哪个是未来数据。
提前致谢。