Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

NextCharts - an Open Source HTML5 library

DZone's Guide to

NextCharts - an Open Source HTML5 library

· Java Zone ·
Free Resource

Get the Edge with a Professional Java IDE. 30-day free trial.

Many applications need nowadays to have charts representation. The options are not so many and depend on what you want to do. Someone may need just to draw a simple chart based on some changing data. Someone may need to draw different kind of charts with a lot of properties.

Looking for an Open Source HTML5 library will show a set of projects, some still active, some abandoned. If you do not have a lot of requirements you may happily discover that such projects can fulfill your needs. But if you need something bigger you have only two options: to buy a big chart library or to to create your own.

NextCharts started just because it was needed inside an open source project and there were many settings involved. NextCharts is just a small HTML5 & JQuery library which can allow to represent the most important charts: bars, horizontal bars, stacked bars, lines, areas, pies and simple line-bars combos.

NextCharts is used by NextReports Server , a reporting server which has dashboards functionality for watching and analyzing data.

Behind this library stands a simple json format which allows to set some specific properties.

A simple bar chart may be defined like:

    {  
       "type":"bar",  
       "data":[[16,66,24,30,80,52],[48,50,29,60,70,58],[30,40,28,52,74,50]],  
       "labels":["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE"],  
       "color":["#004CB3","#A04CB3","#7aa37a"]  
    }  

The result will be the following:

If you want to read more about what can you do with NextCharts, go here . There are also some styles  you can use for bars (like normal, parallelepiped, dome) and for lines dots (like normal, soliddot, star and many others).  Creating combo charts with bars and lines is also possible and you can see how to do it here .

You can find the project on github.

Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}