У меня возникли проблемы с настройкой цвета штрихов для диаграммы столбцов Kendo UI. Вот код:Kendo UI Chart Colors
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="chart"></div>
<script src="js/thirdParty/jquery.js"></script>
<script src="js/thirdParty/kendo.all.min.js"></script>
<script>
$(function() {
var data,
dataSource;
data = [{
type: "C1",
amount: 100,
year: 2008,
color: "red"
}, {
type: "C2",
amount: 120,
year: 2008,
color: "blue"
}, {
type: "C2",
amount: 50,
year: 2009,
color: "blue"
}, {
type: "C1",
amount: 10,
year: 2010,
color: "red"
}, {
type: "C1",
amount: 120,
year: 2011,
color: "red"
}, {
type: "C2",
amount: 50,
year: 2011,
color: "blue"
}];
dataSource = new kendo.data.DataSource({
data: data,
group: {
field: "type"
},
sort: { field: "year" }
});
$("#chart").kendoChart({
dataSource: dataSource,
series: [{
type: "column",
field: "amount",
categoryField: "year",
name: "#= group.value #",
colorField: "color"
}],
})
});
</script>
</body>
</html>
Я пытаюсь получить «C1», чтобы быть красный и «C2», чтобы быть синий но график делает, как в следующем скриншоте:
Любые указатели в правильном направлении будут оценены.
Привет Arun, Есть ли у вас какие-либо идеи следующий вопрос HTTP: // stackoverflow.com/questions/30176594/multi-color-line – casillas