df8883d97079bd7fa7854af53f7c871555360633
FAQ/CustomizeDundasChart.md
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +#CustomizeDundasChart |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +This method is used to customize charts using the Dundas charting engine. In order to use this library for charts, set `AdHocSettings.ChartingEngine = ChartingEngine.DundasChart;`. By default, this setting will be set to this value, but in the standard kit distributed on our site the ChartingEngine is set to HtmlChart. |
|
| 8 | + |
|
| 9 | +Note: As we have switched to HtmlCharts, and with the more current D3 visualizations being the current standard chart type, the Dundas charts are no longer actively maintained. |
|
| 10 | + |
|
| 11 | +##C# Example |
|
| 12 | + |
|
| 13 | +```csharp |
|
| 14 | +public override void CustomizeDundasChart(object chart, Hashtable properties, Type chartType) |
|
| 15 | +{ |
|
| 16 | + if (chartType.FullName != "Izenda.AdHoc.DundasBarChart") |
|
| 17 | + return; |
|
| 18 | + |
|
| 19 | + Dundas.Charting.WebControl.Chart dchart = chart as Dundas.Charting.WebControl.Chart; |
|
| 20 | + if (dchart == null) |
|
| 21 | + return; |
|
| 22 | + |
|
| 23 | + foreach (Dundas.Charting.WebControl.ChartArea chartArea in dchart.ChartAreas) |
|
| 24 | + { |
|
| 25 | + chartArea.AxisY2.Enabled = Dundas.Charting.WebControl.AxisEnabled.False; |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + base.CustomizeDundasChart(chart, properties, chartType); |
|
| 29 | +} |
|
| 30 | +``` |
|
| 31 | + |
|
| 32 | +##VB.NET Example |
|
| 33 | +```visualbasic |
|
| 34 | +Public Overrides Sub CustomizeDundasChart(chart As Object, properties As Hashtable, chartType As Type) |
|
| 35 | + If Not chartType.FullName.Equals("Izenda.AdHoc.DundasBarChart") Then |
|
| 36 | + Return |
|
| 37 | + End If |
|
| 38 | + Dim dchart As Dundas.Charting.WebControl.Chart = DirectCast(chart, Dundas.Charting.WebControl.Chart) |
|
| 39 | + If dchart Is Nothing Then |
|
| 40 | + Return |
|
| 41 | + End If |
|
| 42 | + For Each chartArea As Dundas.Charting.WebControl.ChartArea In dchart.ChartAreas |
|
| 43 | + chartArea.AxisY2.Enabled = Dundas.Charting.WebControl.AxisEnabled.False |
|
| 44 | + Next |
|
| 45 | + MyBase.CustomizeDundasChart(chart, properties, chartType) |
|
| 46 | +End Sub |
|
| 47 | +``` |
|
| ... | ... | \ No newline at end of file |