score:12
based on op's comment, striked my previous answer.
as you are doing,
series.name = item;
and
series.data.push(parsefloat(item));
like wise, you can do,
series.color: '#f6f6f6'
(in your loop you can change color based your conditions )
you can do,
$(document).ready(function() {
var options = {
chart: {
renderto: 'container',
defaultseriestype: 'bar'
},
title: {
text: 'spiritual gifts results'
},
colors: [
'#3bbee3'
],
xaxis: {
categories: []
},
yaxis: {
title: {
text: 'service'
}
},
series: []
};
var data = document.getelementbyid("hdn_data");
// split the lines
if (data.value != "") {
var lines = data.value.split('\n');
// iterate over the lines and add categories or series
$.each(lines, function(lineno, line) {
var items = line.split(',');
// header line containes categories
if (lineno == 0) {
$.each(items, function(itemno, item) {
if (itemno > 0) options.xaxis.categories.push(item);
});
}
// the rest of the lines contain data with their name in the first position
else {
var series = {
data: []
};
$.each(items, function(itemno, item) {
var data = {};
if (itemno == 0) {
series.name = item;
} else {
data.y = parsefloat(item);
if (itemno <= 3) {
data.color = 'gray';
}
else {
data.color = '#3bbee3';
}
series.data.push(data);
}
});
options.series.push(series);
}
});
// create the chart
var chart1 = new highcharts.chart(options);
}
});
refer this, you can give data
in 3 ways. i've used the third one.
score:2
yes, in your push execution you should be able to set color for that point. i am not too familiar with push as we use a precompiled data object that we send. but inside of our .net we set the color (if needed) on a particular point and then send the data object to the chart.
score:16
here is a example
data: [
{ y: 34.4, color: 'red'}, // this point is red
21.8, // default blue
{y: 20.1, color: '#aaff99'}, // this will be greenish
20 // default blue
]
Source: stackoverflow.com
Related Query
- Highcharts Change Bar Color Based on Value
- Highcharts dynamically change bar color based on value
- Highcharts Change Bar Background Color Based on categories value
- Highcharts - Column Chart Drilldown, how to change the drilldown bar color based on some value
- change dataLabels on highcharts based on color of bar
- How to change gauge meter color based on value in highcharts
- How to dynamically change line color based on value being lower than previous in highcharts
- Set color of Highcharts series bar based on value
- How can I change a Highcharts bar color based on a third field?
- Change the color of the bar chart based on the value
- Change Datalabel Color, Rotation and Align values based on Column value in highcharts
- highcharts: column chart color change based on value
- How to change area graph color above certain value in Highcharts
- How do I change a specific bar color in Highcharts Bar Chart?
- Change color code on colum, depending on data value (highchartJS)
- Change the color of bar on condition in highcharts
- How to change the bar color in Highcharts
- How to change color of bar in column chart with different level of percentage in highcharts
- how to get dynamic color change based on values in highcharts
- rCharts : Highcharts column with color based on value
- Highcharts How to change align of data labels based on value
- Highcharts Highmaps How to change value for color axis in map bubble
- Highcharts line color based on other data than value
- HighCharts Create gradiance decress color to blur for each value on bar chart
- How can I change the background color of horizontal bar if date value is less than to current date?
- Change highcharts axis value based on User Selection
- How to change the color of the each slice in piechart based on the backend response using highcharts
- R highcharter bar color based on value
- Yii Highchart extension - Change color based on value
- Highcharts bar chart with bar colored based on value
More Query from same tag
- Aggregate Total with Highcharts Line Chart
- Highstocks is rounding all of my data
- Custom field name in ECharts
- Highcharts donut custom legend text before legendSymbol using labelFormatter
- pointInterval not working with date range within line chart
- HighCharts in R Shiny App
- Highcharts pie get series color in tooltip headerFormat
- Google Charts, HighCharts or ChartJS Dual Axis Gantt Chart and Line Chart Visualization
- Error: Highcharts error #13 ionic angular
- How to show time values in stacked column using High stock
- Highchart, I want to fill between some values(point to point). in areaspline chart
- Highchart - ThingSpeak - IoT - issues with graphs (axes)
- Filtering legend of a Highcharts by only visible series
- Why my Highchart javascript always get the old data from DB
- HighChart and spline: dataGrouping not working
- How to draw Square wave in highchart
- Highcharts - Scatter plot: How to send information from clicks to a function with information about the click as parameters
- Highcharts value bars with full height background bars
- dynamic spline highchart from database
- Highcharts custom legend SVG symbol does not fade when you click to turn off series
- highcharts with year selector
- Highcharts gauge not showing colour as expected
- Highstock data points pixel spacing
- how to access function in Json
- Highcharts 5 data-labels width in CSS
- Not able to show data labels of column in highchart , incorrect format is showing
- Smallest pie can't be seen in HighCharts
- Highcharts - show every other x-axis category
- highcharts column stroke in styled mode
- highcharts correct json input