How can I set custom colors on stroke amchart js library?
-
12-12-2019 - |
Question
I'm using AmCharts Javascript Library to present chart on HTML with SVG (Scalable Vector Graphics). The problems are default stroke colors! I want use my own colors. Is there any way to set the stroke colors?
Solution
You can set the color by graph by using the lineColor
property.
ex.
graph = new AmCharts.AmSerialChart();
graph.linecolor = "#FF0000";
OTHER TIPS
Go to code that start AmChart. After new AmCharts.AmSerialChart()
add the line:
chart.colors = "#000000 #B0DE09 #990000 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(' ');
Each RGB code is a color of a chart from left to right!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow