Skip to content

Commit

Permalink
Fixed #6350, Solid gauge series did not have CSS point class.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbochan committed Apr 24, 2017
1 parent 77bef5b commit 71a651b
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/modules/solid-gauge.src.js
Expand Up @@ -299,7 +299,7 @@ H.seriesType('solidgauge', 'gauge', {
}
} else {
point.graphic = renderer.arc(shapeArgs)
.addClass('highcharts-point')
.addClass(point.getClassName(), true)
.attr({
fill: toColor,
'sweep-flag': 0
Expand Down
@@ -0,0 +1,6 @@
---
resources:
- https://code.jquery.com/qunit/qunit-2.0.1.js
- https://code.jquery.com/qunit/qunit-2.0.1.css
js_wrap: b
...
@@ -0,0 +1,11 @@
<script src="https://code.highcharts.com/js/highcharts.js"></script>
<script src="https://code.highcharts.com/js/highcharts-more.js"></script>
<script src="https://code.highcharts.com/js/modules/solid-gauge.js"></script>
<style>
@import 'https://code.highcharts.com/css/highcharts.css';
</style>

<div id="qunit"></div>
<div id="qunit-fixture"></div>

<div id="container" style="width: 600px; margin: 0 auto"></div>
@@ -0,0 +1,74 @@
QUnit.test('Solid gauge styled series color (#6350)', function (assert) {

var gaugeOptions = {
chart: {
type: 'solidgauge',
animation: false
},

title: null,

tooltip: {
enabled: false
},

pane: {
center: ['50%', '85%'],
size: '140%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},

// the value axis
yAxis: {
stops: [
[0, '#00ff00'],
[1, '#00ff00']
],
lineWidth: 0,
minorTickInterval: null,
tickAmount: 2,
title: {
y: -70
},
labels: {
y: 16
}
},

plotOptions: {
solidgauge: {
dataLabels: {
y: 5,
borderWidth: 0,
useHTML: true
},
animation: false
}
}
};

// The speed gauge
var chart = Highcharts.chart('container', Highcharts.merge(gaugeOptions, {
yAxis: {
min: 0,
max: 200
},
series: [{
data: [80]
}]
}));

assert.strictEqual(
chart.series[0].data[0].graphic.element.className.baseVal,
'highcharts-point highcharts-color-0',
'color classes are applied.'
);

});

0 comments on commit 71a651b

Please sign in to comment.