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

Stacked 100% Bar Chart

2 Answers 46 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 20 Aug 2014, 04:54 PM
Hi,

I have a stacked100 bar chart.  It "seems" to be structured the way I want it structured, it's just the colors aren't contrasting.

I did a mouseover on the "Jan 2014" so you can see it is indeed breaking it into the percentages properly (see attached).

How do I get the colors to contrast or did I simply structure the code incorrectly? (admittedly series and categories confuse me at times)

Thanks for your help.

Code:
            DataTable dt = new DataTable();
            dt = f.CallStoredProcedure("rptHitRate_Chart");
            
            BarSeries b1 = new Telerik.WinControls.UI.BarSeries();
            BarSeries b2 = new Telerik.WinControls.UI.BarSeries();

            b1.CombineMode = ChartSeriesCombineMode.Stack100;
            //b2.CombineMode = ChartSeriesCombineMode.Stack100;        

            chartHitRate_Monthly.Series.Add(b1);

            foreach (DataRow dr in dt.Rows)
            {
                CategoricalDataPoint cdp = new CategoricalDataPoint((double)dr["ApprovalRate"], dr["DateGroup"]);
                CategoricalDataPoint cdp2 = new CategoricalDataPoint((double)dr["DeclineRate"], dr["DateGroup"]);

                b1.DataPoints.Add(cdp);
                b1.DataPoints.Add(cdp2);
            }  

data layout:
DateGroup  ApprovalRate DeclineRate
Jan 2014 0.368421052631579 0.631578947368421
Feb 2014 0.75 0.25
Mar 2014 0.568965517241379 0.431034482758621
Apr 2014  0.423728813559322 0.576271186440678
May 2014 0.392857142857143 0.607142857142857
Jun 2014 0.457627118644068 0.542372881355932
Jul 2014 0.433962264150943 0.566037735849057
Aug 2014 0.315789473684211 0.684210526315789

2 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 20 Aug 2014, 07:46 PM
I should add that I'm using release 2014.2.715.40 (believe to be the most current)
0
Stefan
Telerik team
answered on 21 Aug 2014, 07:30 AM
Hi Ryan,

Thank you for writing.

To modify the hover of a chart element, you need to modify the theme that you are using. Attached you can find a video demonstrating how to do that. The video opens in browser.

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ChartView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or