Здравствуйте!
birzhan.9997:
<chart:colors>
В SerialChart этот элемент указывает какой цвет может использовать граф, в данном случае целый набор колонок относящихся графу. Для певрого графа берётся первый цвет, для второго второй и т.д. (см. AmSerialChart – amCharts Version 3 Documentation ).
Чтобы указать цвет для каждой колонки, нужно использовать свойство colorField у графа:
<chart:graph type="COLUMN"
colorField="columnColor"
...
valueField="income">
И хранить значение цвета в сущности или устанавливать в DataItem в зависимости от того, как загружаются данные.
XML пример
<chart:serialChart id="serialChart"
additionalFields="additional"
addClassNames="true"
autoMargins="false"
categoryField="year"
height="100%"
marginBottom="26"
marginLeft="30"
marginRight="8"
marginTop="10"
startDuration="1"
theme="LIGHT"
width="100%">
<chart:valueAxes>
<chart:axis axisAlpha="0"
position="LEFT"/>
</chart:valueAxes>
<chart:balloon adjustBorderColor="false"
color="WHITE"
horizontalPadding="10"
verticalPadding="8"/>
<chart:graphs>
<chart:graph alphaField="alpha"
balloonText="<span style='font-size:12px;'>[[title]] in [[category]]:<br>
<span style='font-size:20px;'>[[value]]</span> [[additional]]</span>"
dashLengthField="dashLengthColumn"
fillAlphas="1"
title="Income"
type="COLUMN"
colorField="columnColor"
valueField="income">
</chart:graph>
<chart:graph balloonText="<span style='font-size:12px;'>[[title]] in [[category]]:<br>
<span style='font-size:20px;'>[[value]]</span> [[additional]]</span>"
bullet="ROUND"
bulletBorderAlpha="1"
bulletBorderThickness="3"
bulletColor="WHITE"
bulletSize="7"
dashLengthField="dashLengthLine"
fillAlphas="0"
lineAlpha="1"
lineThickness="3"
title="Expenses"
useLineColorForBulletBorder="true"
valueField="expenses"/>
</chart:graphs>
<chart:categoryAxis axisAlpha="0"
gridPosition="START"
tickLength="0"/>
<chart:export/>
<chart:data>
<chart:item>
<chart:property name="year" value="2019"/>
<chart:property name="income" value="35"/>
<chart:property name="expenses" value="24"/>
<chart:property name="dashLengthColumn" value="10"/>
<chart:property name="dashLengthLine" value="10"/>
<chart:property name="columnColor" value="#2900CE"/>
</chart:item>
<chart:item>
<chart:property name="year" value="2020"/>
<chart:property name="income" value="43"/>
<chart:property name="expenses" value="56"/>
<chart:property name="dashLengthColumn" value="10"/>
<chart:property name="dashLengthLine" value="10"/>
<chart:property name="columnColor" value="#6479ec"/>
</chart:item>
<chart:item>
<chart:property name="year" value="2022"/>
<chart:property name="income" value="49"/>
<chart:property name="expenses" value="60"/>
<chart:property name="dashLengthColumn" value="10"/>
<chart:property name="dashLengthLine" value="10"/>
<chart:property name="columnColor" value="#afb0c6"/>
</chart:item>
<chart:item>
<chart:property name="year" value="2023"/>
<chart:property name="income" value="58"/>
<chart:property name="expenses" value="49"/>
<chart:property name="dashLengthColumn" value="10"/>
<chart:property name="dashLengthLine" value="10"/>
<chart:property name="columnColor" value="#000158"/>
</chart:item>
</chart:data>
</chart:serialChart>