Skip to content

Commit

Permalink
Modify ChartModule series to allow dynamically named properties
Browse files Browse the repository at this point in the history
Original work: projectmesa#714 and
projectmesa#1673.

Co-Authored-By: Catherine Devlin <devlinch@corning.com>
  • Loading branch information
Catherine Devlin authored and rht committed May 9, 2023
1 parent 0e9f818 commit 64799c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesa/visualization/templates/js/ChartModule.js
Expand Up @@ -28,11 +28,12 @@ const ChartModule = function (series, canvas_width, canvas_height) {
for (const i in series) {
const s = series[i];
const new_series = {
label: s.Label,
borderColor: s.Color,
backgroundColor: convertColorOpacity(s.Color),
data: [],
};
for (const property in s){
new_series[property] = s[property];
}
datasets.push(new_series);
}

Expand Down

0 comments on commit 64799c3

Please sign in to comment.