skip to main content
Charts > Getting started > Introducing JViews Charts > General architecture of JViews Charts > Data model
 
Data model
Rogue Wave® JViews Charts is based on the Separable Model Architecture. This architecture is a variant of the Model-View-Controller model that was introduced in Swing. In this design, the model manages the data or the values represented by the chart component, while the view manages the graphical representation of the model, and handles interactions on it.
The use of this design in JViews Charts allows you to have a clear distinction between data model that handles the sets of data by means of data sources (or data sets), and data display that draws the graphical representation of data.
The data model handles the data sets by means of data sources. The data set is a single set of data points. A data point is defined by an (X, Y) coordinate pair expressed with double primitives, and an optional label.
The contents of a data source is dynamic and its type depends on the origin of the data (XML, JDBC, Flat file or In-Memory).
The data model distinguishes data series from sources of data. Having distinct entities to represent an elementary set of data and the whole data provides the following benefits:
*Data sets exist as objects rather than internal references within the data model, which makes it easier to reference and use them in an application.
*You can create new data set types and use them with existing data sources. Likewise, you can create new data source types that handle existing data sets.
*You can easily mix data sets that come from different sources (for example, data sets extracted from a database query with data sets whose values are updated by a thread).
*You can create data sets as combinations or wrappers of other data sets.
The data model can comprise Java™ classes or an implicit default model specified in an XML file, a flat file, a database or in-memory.
If you create a new chart with the Charts Designer, you load data from an external data source (XML file, flat file, database, or in-memory Java classes) or from a template.
If you create a new chart using the API, you will use the following interfaces:
*The IlvDataSet interface acts as a data holder. The objects that implement this interface manage data as a set of data points, and provide the required API (Application Programming Interface) to fetch and modify data. An abstract implementation of this interface called IlvAbstractDataSet is provided in the library as well as several concrete implementations. See Using the Data Model in Developing with the SDK.
*The IlvDataSource interface acts as a source of data sets. It handles a collection of data sets and provides the required API to access them.The implementation of this interface allows you to import data from an external package (for example a database, an XML file, and so on) into the Charts library. An abstract implementation called IlvAbstractDataSource is provided in the library as a starting point for your own custom implementation. A concrete memory-based implementation is provided by the IlvDefaultDataSource class.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.