score:1
Accepted answer
You can use setOptions
for color in Highcharts
like below.
Highcharts.setOptions({
colors: ['#ff6600', '#ff0000', '#ffff00']
});
// Build the chart
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares in January, 2018'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [{
name: 'Brands',
colorByPoint: true,
data: [{
name: 'Chrome',
y: 61.41,
sliced: true,
selected: true
}, {
name: 'Internet Explorer',
y: 11.84
}, {
name: 'Firefox',
y: 10.85
}]
}]
});
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
Source: stackoverflow.com
Related Query
- How to set individual colors for high chart pies
- Highcharts Theming: How to set gradient colors for certain chart types only?
- Highcharts how to make a set number of colors for pie chart data and drilldown data
- How to set pie chart wedge colors based on wedge values for highcharts?
- Highcharts - How to set custom colors for the series
- In high chart how to add event for label click
- How to set the x value for High Charts error bar
- How to use add series and update methods in the high chart wrapper for angular?
- How to set variable in high chart data field
- How can I set the alignment for individual axis labels in highcharts?
- HighCharts. How to set a fixed width for a chart grid, not including labels?
- How to set column width for columnRange chart with multiple series
- How to set column colors, title colors , font size , font family in external css file for highcharts?
- How To Set Different Colors For Different Plots In A Same Chart?
- In Highcharts, how to set up title for each pyramid in a multi-pyramid chart
- set individual color for each bar in bar chart using highcharts
- Bar chart in High chart for indication of value with two colors in each bar where one color is always kept fixed
- How to set High maps width and height in percentage for responsiveness?
- How to set color of each slice in pie chart in high charts library?
- ECharts how to set different symbol for different marklines in one chart
- How to set different colors for bars based on value in Highchart bar chart?
- How to set object value in color attribute for high charts legends?
- Why can't I get individual bar colors in a candlestick chart in highstocks.js for more than 55 bars?
- How to get different colors for every column in a stacked column chart
- How to create a legend for bar colors in a Highcharts bar chart
- High Charts for an area-spline chart with area fill on only one data set in series
- how to get each key and value from object in javascript for high chart graph
- How to set tooltip background as point color for split chart in Highcharts?
- How to set specific color for each data in pie chart using phplot.php
- How do I hide the code for the chart data in highcharts?
More Query from same tag
- Highstock, JSON and Android
- Javascript Highchart
- Highchart.js variable length input doesn't work
- Graphics start from axis + grid line
- Change color of selected point in HighCharts dynamically
- How to remove Hyper Link in XAxis name in Highcharts?
- Add Source to Highcharts Export CSV
- Highcharts, export/copy image to clipboard
- How to extract data from an interactive chart?
- Function to call Highcharts with ajax?
- angular2-highcharts first point loses on xAxis
- Highcharts w/React - rendering div not found in JSX
- HighCharts Semi-Circle-Donut, remove margin and padding
- Stacked highchart in php
- How to add apostrophe in front of an integer on x-axis label in Highcharts?
- How can i align the highchart legend pagination to right or left side of the legends?
- show dataLabels or tooltip on Highcharts packed bubble outer circle
- highcharts axis format decimal point
- How to disable Angular Drop Down if the model is null or empty?
- Export Highcharts code from jsfiddle
- How do I make the label in polar chart not get split automatically?
- How to fetch JSON data from HTML DIV on same page for Highcharts?
- json in to a variable and then pass it
- Highchart data each row on gridview to display different data on button click open modal
- Highcharts problems showing last values and close values
- Add highcharts plotband after render in R shiny/rcharts
- Highcharts: click events for heatmaps
- Set additional information in highcharts tooltip
- Highcharts custom export hidding on Reset
- Highcharts callback function / handle datalabels and stacklabels