Does Vega-Lite provide all the features that Vega provides? - javascript

I am trying to develop an interactive chart using Vega-Lite but I am not able to find any documentation that refers to interactive chart, mainly eventlisteners.
So, wanted to know if Vega-Lite has that capability.
Please help me here as I am a newbie and really need to develop an interactive chart preferably using Vega-Lite, if possible; otherwise I will go with Vega.

No. Vega supports everything that vega-lite does, as vega-lite is compiled into vega code. However, vega-lite does not support everything that vega does.
However, if you want to use vega-lite, but want to take advantage of a feature available only in vega (like interactivity), you can start with vega-lite code, convert it into vega code (the online vega editor allows this) and then continue editing the vega code.

Specifying interactivity in Vega-Lite will be possible as of some time in mid-2017. Here is the announcement, including a paper and a demo video: Vega-Lite: A Grammar of Interactive Graphics

As the accepted answer said: No.
Let me provide examples:
SVG graphics support: You can't choose how to render your chart (image, svg) in Vega Lite.
Week timeunit support: You can set timeunit to "week" only in Vega, this missing property is particularly frustrating.
Select drop-down lists: Adding drop down lists that update chart upon selection are available only in Vega.
Some Donut chart styling properties: Vega privdes more options to customize the look of the Donut chart.

Related

Looking for JS chart library with interactive diagrams

In my project I work on a web app that shall provide interactive charts to the user. Interactive is meant in that way that the user can adjust single data points by dragging them around in chart.
More specifically, assume a line chart consisting of six data points. The user clicks one data point and drags it to different coordinates within the chart (drag and drop). Afterwards the line should be rendered again considering the adapted coordinates.
I had a look into Chart.js already but found that this feature is not provided out-of-the-box. I rather have to implement that myself.
Are you aware of any chart library for JS that provides such feature?
UPDATE
Meanwhile I found two potential solutions:
Plugin for Highcharts
Draggable charts of FusionCharts
You can take a look to D3.js, it's battery-included and drag&drop is supported too.
But you have to make the chart in HTML/CSS yourself.

Alternative to Google Charts Timeline

I've been playing around with the Timeline chart from Google Charts. It's great because it's very easy to use. However, I stumbled upon quite some limitations:
It's not possible to adjust the height of the bars, or the amount of margin around them.
I cant format the labels of the hAxis. No fonts can be applied, or textcolor, or font-size. And for some reason, two of the labels are in bold. (see image below)
It's not possible to add a text column on the right containing an extra set of information (for example, the sum of all hours in this row)
I can't move the hAxis to be displayed above the graph instead of below
etc...
Here's a link to the image:
For this reason, I was hoping some of you could introduce me to an alternative tool or api that I can use. It needs to be easy to use, and free/opensource. I've Googled for numerous chart tools, but almost no tools provide this SIMPLE timeline type of chart (note that it's not a Gantt chart, but it looks like one).
There are a few Gantt chart Javascript libraries, but none seem to be close to the Google Timelines chart.
The only chart I could find that is similar is Visavail.js. It builds upon D3.js and is open source, so you can modify it to your liking. Check out the "Custom Category Data" example. It's a lot like a Google Timelines chart.
For your convenience, I've added a screenshot of the example below:
If you are familiar with d3.js, here is a d3js based example: http://bl.ocks.org/bunkat/1962173

Plotting animated pie chart using javascript

I want to create an animated pie chart in JavaScript. I have done some R&D myself and found the Google Charts API.
But my major concern is the actual data is sent to the Google server for creating the charts. I am concerned about sending my data to a third party.
If you're concerned about sharing data with a third party, you might consider an offline charting library, like ZingChart. It gives you the ability to create animated pie charts quickly and easily without the need to transfer any of your data to a third party. This charting library works offline, and is dependency free. There are a number of animations that can be applied to the various types of charts, including pie charts. Check out this animated pie chart demo.
Lists of the different animation effects, methods, and sequences can be found on the animation docs page.
I'm a member of the ZingChart team, so please feel free to ask if you have any questions! :)
I suggest you use jPlot! You can do Pie and Donut Charts, Bar Charts, Line Charts and much more!. See the API here.
A DEMO here.
D3pie is also a good option
They also have a generator that you can use if you want to build your an example and work from there.

D3.js or EXT js for data visualization and why?

I am trying to learn D3 JS and how it can be applied in current application.I am new to this application.
While going through the application I found that there is already a feature providing data visualization in the form of graphs using EXT Js charts.
Could anybody help me understand the advantage of data visualization using ext js over D3 JS and is there any reason for going with one over other? Thanks in advance.
ExtJS is a commercial web app framework for many things including data visualization. D3.js is an open source low level library for creating svg-based charts.
The first question you need to figure out is if you only want charts or all the features that come with ExtJS.
If you just want to draw standard charts (bar, line, area, pie etc.) you may consider using highcharts, google charts, or a higher level library on top of d3.js such as nvd3.js or Rickshaw since they are easier to use. Otherwise if you want a very non-standard and customized chart, d3.js is very powerful for implementing any possible kind of visualization.
D3 is just for visualization, ExtJS is a full framework that hast a lot of other components (grids, windows, layouts, etc...).
Also ExtJS doesn't get well with other libraries, since it overrides several things in the global CSS.
Therefore, if you have a full page that has more than just graphs... feel free to use ExtJS for the whole page, but if you already have something else on the page, then go for D3.

Pie chart with jQuery

I want to create a pie chart in JavaScript. On searching I found the Google Charts API. Since we are using jQuery I found that there is jQuery integration for Google Charts available.
But my problem is here the actual data is sent to the Google server for creating the charts. Is there a way to prevent the data from being sent to Google? I am concerned about sending my data to a third party.
Flot
Limitations: lines, points, filled areas, bars, pie and combinations of these
From an interaction perspective, Flot by far will get you as close as possible to Flash graphing as you can get with jQuery. Whilst the graph output is pretty slick, and great looking, you can also interact with data points. What I mean by this is you can have the ability to hover over a data point and get visual feedback on the value of that point in the graph.
The trunk version of flot supports pie charts.
Flot Zoom capability.
On top of this, you also have the ability to select a chunk of the graph to get data back for a particular “zone”. As a secondary feature to this “zoning”, you can also select an area on a graph and zoom in to see the data points a little more closely. Very cool.
Sparklines
Limitations: Pie, Line, Bar, Combination
Sparklines is my favourite mini graphing tool out there. Really great for dashboard style graphs (think Google Analytics dashboard next time you login). Because they’re so tiny, they can be included in line (as in the example above). Another nice idea which can be used in all graphing plugins is the self-refresh capabilities. Their Mouse-Speed demo shows you the power of live charting at its best.
Query Chart 0.21
Limitations: Area, Line, Bar and combinations of these
jQuery Chart 0.21 isn’t the nicest looking charting plugin out there it has to be said. It’s pretty basic in functionality when it comes to the charts it can handle, however it can be flexible if you can put in some time and effort into it.
Adding values into a chart is relatively simple:
.chartAdd({
"label" : "Leads",
"type" : "Line",
"color" : "#008800",
"values" : ["100","124","222","44","123","23","99"]
});
jQchart
Limitations: Bar, Line
jQchart is an odd one, they’ve built in animation transistions and drag/drop functionality into the chart, however it’s a little clunky – and seemingly pointless. It does generate nice looking charts if you get the CSS setup right, but there are better out there.
TufteGraph
Limitations: Bar and Stacked Bar
Tuftegraph sells itself as “pretty bar graphs that you would show your mother”. It comes close, Flot is prettier, but Tufte does lend itself to be very lightweight. Although with that comes restrictions – there are few options to choose from, so you get what you’re given. Check it out for a quick win bar chart.
jqPlot looks pretty good and it is open source.
Here's a link to the most impressive and up-to-date jqPlot examples.
Tons of great suggestions here, just going to throw ZingChart onto the stack for good measure. We recently released a jQuery wrapper for the library that makes it even easier to build and customize charts. The CDN links are in the demo below.
I'm on the ZingChart team and we're here to answer any questions any of you might have!
$('#pie-chart').zingchart({
"data": {
"type": "pie",
"legend": {},
"series": [{
"values": [5]
}, {
"values": [10]
}, {
"values": [15]
}]
}
});
<script src="http://cdn.zingchart.com/zingchart.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.zingchart.com/zingchart.jquery.min.js"></script>
<div id="pie-chart"></div>
A few others that have not been mentioned:
For mini pies, lines and bars, Peity is brilliant, simple, tiny, fast, uses really elegant markup.
I'm not sure of it's relationship with Flot (given its name), but Flotr2 is pretty good, certainly does better pies than Flot.
Bluff produces nice-looking line graphs, but I had a bit of trouble with its pies.
Not what I was after, but another commercial product (much like Highcharts) is TeeChart.
Chart.js is quite useful, supporting numerous other types of charts as well.
It can be used both with jQuery and without.
There is a new player in the field, offering advanced Navigation Charts that are using Canvas for super-smooth animations and performance:
https://zoomcharts.com/
Example of charts:
Documentation: https://zoomcharts.com/en/javascript-charts-library/charts-packages/pie-chart/
What is cool about this lib:
Others slice can be expanded
Pie offers drill down for hierarchical structures (see example)
write your own data source controller easily, or provide simple json file
export high res images out of box
full touch support, works smoothly on iPad, iPhone, android, etc.
Charts are free for non-commercial use, commercial licenses and technical support available as well.
Also interactive Time charts and Net Charts are there for you to use.
Charts come with extensive API and Settings, so you can control every aspect of the charts.
Check TeeChart for Javascript
Free for non-commercial use.
Includes plugins for jQuery, Node.js, WordPress, Drupal, Joomla, Microsoft TypeScript, etc...
Interactive demos here and here.
Some screenshots of some of the demos:

Categories

Resources