Charts
Charts (Wisej.Web.Ext.Charts) is the first experiment at bringing Chart.js into Wisej.NET. It bundles Chart.js 1.0.1 and exposes a single Chart control. That control always renders the same bar chart, with seven monthly labels and two data sets of sample values. It has no properties or methods for setting the chart type, labels or data.
Work in progress: not for applications
What it's useful for
The source is a compact illustration of the smallest possible JavaScript-backed control. There are three parts:
- A server class.
Chartderives fromControland overridesOnWebRender. It setsconfig.classNameto the client class to create, then adds the properties that class expects (chartType,data) to the configuration object. - A client class.
Platform/Chart.jsdefineswisej.web.ext.Chartwithqx.Class.define. It extendswisej.web.Control, replaces the content element with a canvas, declareschartType,dataandoptionsproperties, and creates the Chart.js instance when the control first appears. - The library itself,
Platform/chart-js.js, embedded in the assembly next to the client class.
That pattern (render the configuration on the server, apply it in a qooxdoo class in the browser) is the one full extensions build on. For the concepts behind it, see JavaScript and JavaScript Object Model in the user guide.
A simpler route: Widget
Usage
If you build it from source, the control is used like any other:
- C#
- VB.NET
var chart = new Wisej.Web.Ext.Charts.Chart
{
Dock = DockStyle.Fill
};
this.Controls.Add(chart);
Dim chart As New Wisej.Web.Ext.Charts.Chart With {
.Dock = DockStyle.Fill
}
Me.Controls.Add(chart)
API reference
Chart- The whole
Wisej.Web.Ext.Chartsnamespace