To quote Shneiderman’s mantra Overview first, zoom and filter, then details-on-demand.The zoom line chart is probably the best application of this mantra. First off, this chart can handle a larger amount of data points than any other chart. The example below has around 18 thousand data points of stock prices across 25 years.
Zoom Out
button would take you to the previous zoom level. If you want to jump back to the default chart view, click Reset Chart
. That’s the beauty of the zoom line chart – you can zoom down all the way to view fluctuations by the day, or even minutes.. Switch to Zoom Mode
button. As you can see, the Zoom Line chart proves very useful in making sense of large datasets, especially when you want to see the overall trends and the minute patterns simultaneously. While the Zoom Line chart will not be able to handle data in the realm of Big Data that is about a few gigabytes, it can handle about 20,000 data points quite easily. Creating a zoom line chart is similar to creating other multi-series charts. Let us walk through the process of creating a zoom line chart which plots the daily stock prices of Adobe (ADBE), Apple Inc. (AAPL) and Microsoft (MSFT) for the last 25 years. First you need to have the <chart>
element. <chart caption="Stock Prices of last 25 Years" numberprefix="$" dynamicAxis="1" bgcolor="ffffff">
Then specify the <categories>
for the chart, which in this case are the dates. <categories> <category label="08/14/1986"/> <category label="08/15/1986"/> <category label="08/18/1986"/> ... ... <category label="08/22/2011"/> <category label="08/23/2011"/> <category label="08/24/2011"/> </categories>And then you specify each of the datasets. For this example, we have one dataset each for ADBE, AAPL and MSFT. Within each datasets you
<set>
the value of the stock price for that date. <set value="356.03"/> <set value="356.44"/> <set value="356.44"/> <set value="373.6"/>With so many data labels on the X-axis, it gets difficult to see which data point lies on which date. To solve this problem, we’ve come up with Vertical divisional lines. These lines can be displayed on the chart canvas, above each data label. Enable them by declaring the
showVDivLines="1"
attribute of the <chart>
element. This readies your XML data for the chart. The zoom line chart also supports an alternative compact XML/JSON format, which simplifies the XMLization/JSONization of large quantities of data. In compact XML/JSON format categories and datasets are defined in the following manner: <categories>Label 1|Label 2|Label 3|Label 4|Label 5| ... </categories> <dataset seriesName='ABDE'>182|236|17|406|676|... </dataset> <dataset seriesName='AAPL'>294|170|450|120|844|... </dataset> <dataset seriesName='MSFT''>294|170|450|120|844|... </dataset>If you use the compact XML/JSON format, then don’t forget to include the
compactDataMode="1"
and dataSeparator="|"
attributes in the <chart>
element. In your HTML file, copy the following to get the zoom line chart: <html> <head> <title>Share Price of ADBE, AAPL and MSFT for last 25 years</title> <script language="JavaScript" src="FusionCharts.js"></script> </head> <body bgcolor="#ffffff"> <!-- Start Code for FusionCharts chart --> <div id="chartdiv" align="center">FusionCharts</div> <script type="text/javascript"> var myChart = new FusionCharts("ZoomLine.swf", "chartID1", "600", "450", "0", "1"); myChart.setDataURL("data.xml"); myChart.render("chartdiv"); </script> <!-- End Code for FusionCharts chart --> </body> </html>Download the sample zoom line chart we’ve showcased in this post. Dive into the massive but simple XML document to see its structure. The next time you encounter a situation where a large data set needs to be visualized, the zoom line chart would be a great fit. Your users will be delighted to interact with the data. And both of you could save time and effort of juggling between multiple charts. See more samples of the zoom line chart and go through the documentation. If you have some thoughts about the zoom line chart, or have an interesting use case where you’ve already used it, please let us know in the comments below.
We’re excited to announce the upcoming release of FusionCharts v4.1—a groundbreaking step forward in the…
Have you ever been overwhelmed by a massive data set and wondered, "How do I…
If you’ve ever tried to make sense of the stock market, you’ve probably come across…
Imagine you’re comparing the sales performance of your top product lines across different regions, or…
Have you ever spent hours buried in documentation, hunting for a specific piece of code?…
Do you feel like your data is a cryptic puzzle, locked away from revealing its…