tinku
tinku

Reputation: 47

Draw Chart using Dimple JS with DSV format data

I'm able to draw the chart using DimpleJS with data as tsv format as the example shown below...

var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {
  var myChart = new dimple.chart(svg, data);
  myChart.setBounds(60, 30, 510, 305)
  var x = myChart.addCategoryAxis("x", "Month");
  x.addOrderRule("Date");
  myChart.addMeasureAxis("y", "Unit Sales");
  myChart.addSeries(null, dimple.plot.bar);
  myChart.draw();
});

I want to draw the chart with dsv (delimiter separated values) format data using the below code as suggested in the D3 Documentation on dsv format data

d3.dsv("/data/example_data.dsv","|", "text/plain", function(data) { ........ });

Does DimpleJS support DSV format data? Please provide me an example or a link to how to draw chart using DimpleJS with DSV format data

Upvotes: 1

Views: 588

Answers (1)

John Kiernander
John Kiernander

Reputation: 4904

There's no difference. I haven't used the dsv method but if it works it would just be:

var svg = dimple.newSvg("#chartContainer", 590, 400);
var dsv = d3.dsv("|", "text/plain");
dsv("/data/example_data.dsv", function (data) {
  var myChart = new dimple.chart(svg, data);
  myChart.setBounds(60, 30, 510, 305)
  var x = myChart.addCategoryAxis("x", "Month");
  x.addOrderRule("Date");
  myChart.addMeasureAxis("y", "Unit Sales");
  myChart.addSeries(null, dimple.plot.bar);
  myChart.draw();
});

Upvotes: 1

Related Questions