This is a migrated thread and some comments may be shown as answers.

Line chart line color change

1 Answer 188 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 21 Mar 2014, 05:49 PM
Unfortunately the color binding is not working:

            <div id="CounterChart" class="dsb-production-chart" data-bind="visible: group4ChartView()">                
                <div id="CounterChart2" data-role="chart"
                     data-legend="{ position: 'bottom' }"
                     data-series-defaults="{ type: 'line' }"
                     data-series="[
                                     { field: 'OutputCounter', name: 'Output'},
                                     { field: 'RejectCounter', name: 'Reject'},
                                     { field: 'TotalCounter', name: 'Total'}
                                 ]"
                     data-series-line-color:"['yellow','red','green']"                     
                     data-bind="source: LineChartCounters"></div>
                </div>
            </div>
                   

What did I wrong?

kind regards
Alex

1 Answer, 1 is accepted

Sort by
0
Kevin Kembel
Top achievements
Rank 1
answered on 21 Mar 2014, 09:42 PM
Hi Alexander,

I've never touched on the MVVM, but I wonder if this would work:

data-series="[
  { field: 'OutputCounter', name: 'Output', color: '#FFF000'},
  { field: 'RejectCounter', name: 'Reject', color: '#FF0000'},
  { field: 'TotalCounter', name: 'Total', color: '#00FF00'}
]"
Tags
Charts
Asked by
Alex
Top achievements
Rank 1
Answers by
Kevin Kembel
Top achievements
Rank 1
Share this question
or