Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
aurelia-chart
Advanced tools
A simple element to handle showing charts (uses chart js behind the scenes)
A simple binding to let aurelia and chartjs (2.x) come together for the greater good.
It supports the basic graph types and should work with any custom ones.
Since version 0.2.0 of this library it has moved over to use the newer chartjs 2.x, which means schemas are now slightly different for certain graphs (like pies) and some of the properties have been renamed. So if you need to stick with the old chartjs (1.x) syntax use versions of this library < 0.2.0. Also in the latest chartjs the type syntax is lower case now, so you no longer need to worry about caps.
use JSPM:
jspm install github:grofit/aurelia-chart
then include the plugin in aurelia
aurelia.use.plugin("aurelia-chart");
After MANY hours of soul destroying asking of questions and finding out system.js seems to have a weird bug, there is now a space age example available for you to see:
You can see the code and everything in the examples folder!
So there is a lot of magic behind the scenes to allow for observable hook-ins, there are a few issues which require a bit of advance warning.
should-update
, and a graph will only update if should-update
is trueIt is a bit more resource intensive than we would like dynamically updating the data in the charts, it is not super meltdown but it can slow things down if you are changing a lot of data in a short space of time. So it is recommended to put a throttle on for at least 100 or higher to make sure you are not refreshing too much.
The element expects a type element describing what type of chart you want and the data you wish to expose:
<chart type="bar" data.bind="myData"></chart>
Or it can be called with a options if you require more control over the chart:
<chart type="pie" data.bind="myData" native-options.bind="{ segmentShowStroke: true, segmentStrokeColor: '#fff', segmentStrokeWidth: 2 }"></chart>
Or you can tell it to listen to observable changes: (Not working due to re-structuring of aurelia bindings atm)
<chart type="pie" data.bind="myData" should-update="true" throttle="100"></chart>
Finally there is also support for attributes directly on the canvas:
<canvas chart="type: pie; data.bind: myData; should-update: true; throttle: 100;"></canvas>
So you can have finer grained control over the element yourself if needed.
The chartjs specific options can be found here:
http://www.chartjs.org/docs/#line-chart-chart-options
http://www.chartjs.org/docs/#bar-chart-chart-options
http://www.chartjs.org/docs/#radar-chart-chart-options
http://www.chartjs.org/docs/#polar-area-chart-chart-options
http://www.chartjs.org/docs/#doughnut-pie-chart-chart-options
The available attributes are:
FAQs
A simple element to handle showing charts (uses chart js behind the scenes)
The npm package aurelia-chart receives a total of 391 weekly downloads. As such, aurelia-chart popularity was classified as not popular.
We found that aurelia-chart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.