Hi, i have a stacked bar chart with color rules sat.
with this setup if new values arrives from the data that should be inserted in the color rules, the stack is shown black, regardless of the value.
The only way I have to correct it is to open the graph, redo the assignment of the “choose data displayed using color”.
Is there no setting such that dundas generates random colors for new values?
I tried to create a script like this
function getRandomColor() {
var letters = ‘0123456789ABCDEF’;
var color = ‘#’;
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
var points = chart1.control.series[0].getPoints();
points.forEach(function(point) {
point.fill = new dundas.controls.SolidColorBrush(getRandomColor());
var newObject = new dundas.controls.LegendItem();
newObject.text=point.colorValues;
newObject.isVisible=true;
newObject.markerFill=point.fill;
legend1.control.addItem(newObject);
point.isDisplayedInLegend=true;
});
but the colors are different for each datapoint and do not respect the values of the series.
Can you help me? thank you