7e44aa9e67e6a6ca02176754144c719535e06cf9
FAQ/CustomizeChart.md
| ... | ... | @@ -155,6 +155,23 @@ _**Note:** Since the chart is rendered after any javascript page events are call |
| 155 | 155 | </div> |
| 156 | 156 | ``` |
| 157 | 157 | |
| 158 | +Below is a simple method for resetting the array of colors a chart draws from. |
|
| 159 | + |
|
| 160 | +```csharp |
|
| 161 | +public override void CustomizeChart(object chart, Hashtable properties) |
|
| 162 | +{ |
|
| 163 | + string newColors = "['#aa00ff', '#ccdd55', '#11ff44', '#dddeee', '#bababa', '#ccccee', '#fdae6b', '#fdd0a2', '#31a354', '#74c476', '#a1d99b', '#c7e9c0']"; |
|
| 164 | + |
|
| 165 | + StringBuilder csb = (StringBuilder)chart; |
|
| 166 | + string content = chart.ToString(); |
|
| 167 | + content = Regex.Replace(content, @"(?<=colors:\s+)htmlChartColors", newColors); |
|
| 168 | + csb.Remove(0, csb.Length); |
|
| 169 | + csb.Append(content); |
|
| 170 | +} |
|
| 171 | +``` |
|
| 172 | + |
|
| 158 | 173 | ##VISION |
| 159 | 174 | |
| 160 | -Visualizations must be customized directly within the /Vis directory. Please see the D3 documentation for more information. https://github.com/mbostock/d3/wiki |
|
| ... | ... | \ No newline at end of file |
| 0 | +Visualizations must be customized directly within the /Vis directory. Please see the D3 documentation for more information. https://github.com/mbostock/d3/wiki |
|
| 1 | + |
|
| 2 | +You can also check the Izenda wiki page for [[customizing a visualization|/FAQ/How-Do-I-Customize-A-Visualization]] for examples. |
|
| ... | ... | \ No newline at end of file |