[v1.4.0] Typescript 1.5, Plots.Waterfall, Plots.Pie label Formatter
Overview
Plottable now uses Typescript 1.5! Depending on your version of Typescript you may need to add or delete touch-events.d.ts from your project. Please review the upgrade instructions.
We're excited to introduce a new plot: Plots.Waterfall. New features and bug fixes have been added to Plots.Pie. These changes ensure that labels work as intended and give you the ability to format labels.
Typescript 1.5
Plottable has been upgraded to use Typescript 1.5. The only major change affecting Plottable users at this time is that Typescript 1.5 includes definitions for TouchEvent; consequently, Plottable no longer has a dependency on touch-events.d.ts.
: Depending on your current version of Typescript, you may need to add or remove touch-events.d.ts. Instructions are here.
Features
Plots.Waterfall
Plots.Waterfall has been added as an extension of Plots.Bar. This plot can be used to show how positive and negative deltas affect initial values.
Note that horizontal orientation is not an option for Plots.Waterfall, and .labelsEnabled() has not been implemented yet.
In addition to the traditional .x() and .y() accessors for plots, the following API points have been added:
.total()/.total(total)- gets/sets anAccessorwhich will return true for each data point representing a total, and false for data points representing deltas. The function given to this endpoint must return a boolean..connectorsEnabled()/.connectorsEnabled(enabled)- gets/sets whether connector lines, indicated below, should be shown.
Try it out: http://jsfiddle.net/h91a5pnj/
Formatter for labels on Plots.Pie
The labels on Plots.Pie can now be formatted using a Formatter. The new API points on Plots.Pie are:
labelFormatter(): Formatter;
labelFormatter(formatter: Formatter): Plots.Pie;Try it out: http://jsfiddle.net/xLhh903y/
Bugfixes
autorangeMode()now works correctly onPlots.LineandPlots.Segment. Previously, using autorangeMode() would have resulted in larger domains than expected. Now there will be a tight domain around the data on the plot. (#2472).- The function passed to
Legend'ssymbol()method now uses the correct indices. This allows you to use the index of a legend entry to change the shape of its icon. (#2106). - On
Plots.Pie, labels will update when data changes. They are also removed whenlabelsEnabled()is set to false (#2483).


