Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

can i remove spesific color when i use colorByPoint in highchart?

i have some problem when i use colorByPoint: true , my co dont want the black color , so i try this

 colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE',
                                                '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'],

below colorByPoint, but its seems not working on my highchart code , i dont know how , but when i try in fiddle its working , can anyone help me what wrong with my code , my full code here

Highcharts.chart('container'+index, {
                                    chart: {
                                        type: 'column'
                                    },
                                    title: {
                                        useHTML: true,
                                        text: title_mul2,
                                        style: {
                                            font: '26px Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif'
                                        }
                                    },
                                    credits: {
                                        enabled: false
                                    },
                                    xAxis: {
                                        categories: categories_mul2,
                                        labels: {
                                            useHTML: true  
                                        } 
                                        //images: image_mul2
                                    },
                                    yAxis: {
                                        title: {
                                            text: null
                                        },
                                        allowDecimals: false,
                                        stackLabels: {
                                            style: {
                                                color: '#000000',
                                                fontSize: '15px',
                                                fontWeight: 'bold'
                                            },
                                            enabled: true,
                                            verticalAlign: 'top'
                                        }
                                    },
                                    plotOptions: {
                                        column: {
                                            stacking: 'normal',
                                            pointPadding: 0,
                                            groupPadding: 0,
                                            dataLabels: {
                                                enabled: false
                                            },
                                            colorByPoint: true
                                        }
                                    },
                                    colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE',
                                            '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'],
                                    legend: {
                                        enabled: false
                                    },
                                    series: [{
                                        data: data_ku1
                                    }]
                                });

if another way to remove black color ? or make if else in data dynamic ? thanks guys

question from:https://stackoverflow.com/questions/65887926/can-i-remove-spesific-color-when-i-use-colorbypoint-in-highchart

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...