[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[chart8] Render Demo

We render the Demo chart here as a basic test to ensure library is loaded and works at least for rendering a basic chart.

"Open a view controller to host a chart view"
VC := UIViewController instance.
VC	title: 'HIChartView sample';
	openOnTop

"Render a chart"
| chartView options chart title series |
chartView := HIChartView withFrame:
	(0@0 extent: VC view boundingBox extent).
options := HIOptions instance.
chart := HIChart instance.
chart type: #column.
options chart: chart.
title := HITitle instance.
title text: 'Demo chart'.
options title: title.
series := HIColumn instance.
series data: #(
	49.9 71.5 106.4 129.2 144 176
	135.6 148.5 216.4 194.1 95.6 54.4
).
options series: (Array with: series).
chartView options: options.
VC view addSubview: chartView.