12.07.2015 Views

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Model View ControllerFigure 6–4: Data Model with Name-Value PairsThe name-value pairs in the data model comprise all of the properties in the data model class, minus those properties markedZENHIDDEN, plus any properties added by %OnGetPropertyInfo, minus any properties deleted by %OnGetPropertyInfo.By default, the number of series is 1, but it could be larger. If there are multiple series in the model, conceptually it becomesa matrix.Figure 6–5: Data Model with Data SeriesYou can add multiple series to the model if you write your own %OnLoadModel method, as in the SAMPLES classZENMVC.ChartDataModel2, shown below. This example creates three series for the model and assigns values to data modelproperties in each of the series.Class ZENMVC.ChartDataModel2 Extends %ZEN.DataModel.ObjectDataModel{Property Cars As %Integer;Property Trucks As %Integer;Property Trains As %Integer;Property Airplanes As %Integer;Property Ships As %Integer;Method %OnLoadModel(pSource As %RegisteredObject) As %Status{Set scale = 100#; This model has multiple data series. We set up the data series here.Set ..%seriesCount = 3Set ..%seriesNames(1) = "USA"Set ..%seriesNames(2) = "Europe"Set ..%seriesNames(3) = "Asia"#; Now we provide data for each property within each series.#; We use the %data array so that we can address multiple series.For n = 1:1:..%seriesCount {186 <strong>Using</strong> <strong>Zen</strong> <strong>Components</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!