score:12
Accepted answer
try this:
// 'series' is an array of objects with keys:
// - 'name' (string)
// - 'data' (array)
// - 'color' (html color code)
var newseriesdata = {
name: name,
data: data,
color: color
};
score:1
it looks to me like you are not looping through the array of data and/or you only have one set of data in data
.
score:5
the way to specify a color for a specific series is to define it when you're defining the series. for example:
series: [{
name: 'john',
color: '#0066ff',
dashstyle: 'shortdash',
data: [
[date.utc(2010, 0, 1), 29.9],
[date.utc(2010, 2, 1), 71.5],
[date.utc(2010, 3, 1), 106.4]
]
},
so essentially when you're creating your series in your drawchart function, do a check for the name, and appropriately assign a color:
var color;
if(name=="swell height"){
color="#0066ff";
}else if(name=="maximum breaking wave height"){
color="#0066ee";
}else if(name=="swell period"){
color="#0066hh";
}
var newseriesdata = {
name: name,
data: data,
color: color
};
Source: stackoverflow.com
Related Query
- Change Highcharts Series color
- Highcharts hide series without change legend color
- Change color of series onclick events across multiple highcharts
- Highcharts - change series color on MouseOver
- How to change the color of highcharts series graph to black & white during downloading it as an image?
- Highcharts change crosshairs color by number of visible series
- change datalabels color in a HighCharts chart when hovering without updating the series
- highcharts change series color when data is dynamically inserted
- Highcharts : Change color of series when hovering other series
- Change color of different points in same series Highcharts
- Highcharts PIE chart series color doesn't change
- Changing series color in highcharts dynamically
- How to change the text color in Highcharts
- Highcharts Change Bar Color Based on Value
- Highcharts dynamically change bar color based on value
- Change Color of Volume Columns (High/Low) in HighCharts
- Highcharts - change background color along specific date range
- Change color of area chart programmatically in highcharts
- Highcharts column range change color for negative numbers
- Highcharts Change column color on hover
- Change Y Axis vertical line color in Highcharts
- Highcharts - how to disable color change on mouseover/hover
- How to change series legend text color in HighChart chart?
- Stop HighCharts change transparency of another series on hover of one series
- Highcharts : Showing wrong color in data series
- Highcharts - change color of only clicked column
- How to change Highcharts xAxis label color individually?
- How to change area graph color above certain value in Highcharts
- Highcharts Change Bar Background Color Based on categories value
- Highcharts, how to change hover bg color for series with multiple columns (categories)
More Query from same tag
- Set the number formatting in general for a Highcharts chart?
- HighCharts(iOS) -How to show tooltip by default at only some positions
- How do I change a specific bar color in Highcharts Bar Chart?
- styling of particular segments in highchart axis
- Highcharts export customize axis label and fontsize: No effect after migration
- Verify if Pie in Highcharts Pie charts is selected or deselected
- Using highcharts SvgRenderer class in angular 4
- how can we make bar width dynamic in highcharts?
- Is possible to export programmatically a highcharts chart?
- Create Highcharts data label formatter that filters the data to display
- customs sticks in piecharts using highcharts
- Highcharts - XAxis Label with LineFeed - how to make smaller gap?
- Remove padding above bar columns
- Highcharts - SetState (inactive) not working after redraw
- how to reduce padding when embedding highcharts?
- Show ranges as legend for highcharts angular gauge
- Split one JSON return into several objects
- Highcharts - Sankey chart - How to display some series dataLabels name into icon or some different name
- how to use tickInterval or step in the highcharts?
- how to set chart in center on full screen view in highchart
- Angular-highcharts colors. Is there any way to get color besides Highcharts.getOptions().colors[index]?
- Highcharts C# To JSON - Structuring Series Data
- How to set Y axis with equal interval in Highcharts?
- Get Highcharts Series Data after Load
- my highchart is currently is not working with pie spline chart in updating after rendering chart
- Change HighCharts axis title
- Highcharts plotBand animation
- How to customize highcharts for this graph
- Highcharts sankey. Highlight all paths of a given category
- use multiple json calls for drawing multiple lines on highcharts php