A Highcharts/Highstock Js API wrapper for Smalltalk
Table of Contents
- Getting Started
- Running the tests
- Future work
- About Highcharts Js
The builder (the tool that auto-generates the code), however, only works on Pharo.
By default we load the stable version of Seaside, but the wrapper will likely work on any Seaside 3 version. So you can lock the Seaside baseline to whatever version you're using.
You can load the framework with (change master to some released version if you wan't a pinned version):
Metacello new baseline: 'HighchartsSt'; repository: 'github://ba-st/HighchartsSt:master/repository'; load.
There's several groups to choose when loading:
Highchartswill load the runtime support for Highcharts
Highstockwill load the runtime support for Highstock
Toolswill load the code generation tool
Developmentwill load all the packages including the tests and the code generation tool
To have Highcharts working, the only thing you must do is to register the wanted HighchartsLibrary into your app root class (notice there are 3 possible subclasses of it). Example:
yourApp addLibrary: JQDevelopmentLibrary; addLibrary: Highcharts6OnlineLibrary.
Then you can render a basic chart like this:
renderBarGovermentComputersChartOn: html | chart series data | data := OrderedCollection new add: (ChartDatum belongingTo: 'Facebook' withValue: 515333); add: (ChartDatum belongingTo: 'YouTube' withValue: 178001); add: (ChartDatum belongingTo: 'GMail' withValue: 154504); add: (ChartDatum belongingTo: 'Twitter' withValue: 184083); add: (ChartDatum belongingTo: 'Amazon' withValue: 100762); add: (ChartDatum belongingTo: 'Pandora' withValue: 78868); yourself. series := ChartSeries named: 'John' composedOf: data. html text: 'chart: '. chart := html highcharts newChart. chart yAxis title text: 'Visits'. chart legend enabled: false. chart chart type: 'column'. chart title text: 'Sites visited on D.C. government computers'. chart subtitle text: 'Source: District of Columbia'. chart xAxis title text: 'Site'. chart xAxis type: 'category'. chart plotOptions column colorByPoint: true. chart plotOptions column dataLabels enabled: true. (chart addSeriesForType: 'column') index: 0; name: series name; data: (series dataAsPointsOn: html). html div script: chart
The default installation of Highcharts includes some examples. You can start your Seaside adaptors, for example like this:
(ZnZincServerAdaptor port: 9999) codec: GRPharoUtf8Codec new; start.
And then watch the live examples with your browser in
Running the tests
Tests are auto-generated for the auto-generated code. These are under the packages
HighstockStV6-Tests. We warned that there's more than 40K test so it will take a while to run, and later be shown in the Test Runner.
Besides the issues, the following are also desired features:
- Support Highmaps
- Improve documentation
- Improve CI Support to test independently the several groups available
- Deploy the examples to the cloud
- Automatically propose Pull Requests when new versions of Highcharts are available
- The Mercap Team and Maximiliano Tabacman for the original implementation.
- The Quuve Team and Mariano Martinez Peck for the Pharo port and further development and improvements.
See also the list of contributors who participated in this project.
This wrapper is licensed under the MIT License. Any contribution submitted to this repository is considered to be under the MIT license.