2 year anniversary

In memory dataset


PageHome.ts

import V = require(“VCL/VCL”);
 
export class PageHome extends V.TPage {
   constructor() {
    super();
    var arr: any[] = [];
    arr.push({ name: “steve jobs”, age: 52 });
    arr.push({ name: “larry david”, age: 66 });
    arr.push({ name: “Mark Zuckerberg”, age: 29 });
 
    //creage an in memory dataset
    var dt = new V.TDataset(this);
    dt.setData(arr);
 
    //bind the pie chart to the data set
    var pie = new V.TDBChartDonut(this, “Donut”);
    pie.Dataset = dt;
    pie.LabelField = “name”;
    pie.ValueField = “age”;
  }
}

PageHome.html

<div>
      <div id=”Donut”/>
</div>
 
 

This entry was posted in Code Snippet and tagged , , . Bookmark the permalink.
  • Chris

    tip: the example is a bit wrong — use:

    this.rs = new V.TClientDataset(this);
    this.rs.setData(data);