New Chart options in MLJS…

I’ve added a couple new features in charts. Read on for details…

The fantastic HighCharts javascript widget library is provided free of charge with MarkLogic server for use with any MarkLogic integrated application. I have developed a thin wrapper widget in the past that links this API to my MLJS MarkLogic JavaScript REST API wrapper. This makes it easy to visualise document information from search results in a chart.

My MLJS highcharts widget calculates multiple series on the fly based on a property name which holds the series value within a JSON document result itself. This differs from how the visualisation widgets in core MarkLogic work in that they only work based on a single facet’s values – so are always single series only.

The advantage of my approach was that you could graph multiple series on the same chart based on document values, and calculate these aggregations without needing range indexes over those fields. The disadvantage was that the result set page size needed to always be bigger than the total number of results in order to provide accurate information. This of course meant shipping over a lot of information to the browser from MarkLogic – every document in the result set.

Data Sources

I’ve now added support for sourcing this information from Facet values. Currently I only support one facet per chart, just like the visualisation widgets, but I have a longer term aim to add multiple to the same chart, and provide multi axis support.

The three data options now are dynamic series names and in document values, hard coded series name and in document values, and a single hardcoded series name and facet values. More details on how you use each can be found in the tutorial on the documentation website.

Chart types

I’ve previously tested Line, Spline, stacked line, column, stacked column, bar, stacked bar, area, and stacked area. I’ve just now added pie chart support to bring my widget in line with the ML Visualisation Widgets.


I hope to add multi series and axes support soon and add more pages in the sample app to test other chart types. If there is a particular chart type you want then please comment on this post!

I also plan on developing some other chart types not based on highcharts, especially network diagrams and force directed diagrams. These are great for browsing graph based data visually.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.