質問

I have AmStockChart which is initialized by JSON with variable count of fields (usually near 20). I do not set color anywhere now.

By clicking on graph label selected graph disabling and all the others change colors.

Yes, I can set colors for each graphs, but my colors are not as beautiful :)

How can I prevent color switching?

役に立ちましたか?

解決

Solved problem for serial chart by setting colors option:

AmCharts.makeChart("chartdiv", {
    ...
    'colors':["#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01",
          "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF",
          "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333",
          "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25",
          "#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01",
          "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF",
      ],
    ...
});

We need more colors in 'colors' than graphs on chart.

For AmSerialChart I use 'color' option for each graph.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top