mesa icon indicating copy to clipboard operation
mesa copied to clipboard

How to adapt tick labels for horizontal axis in ChartModule?

Open stefaneidelloth opened this issue 3 years ago • 4 comments

Instead of steps I would like to show year numbers on the horizontal axis:

image

=> Can I do so in Python (e.g. by inheriting from ChartModule.py) or do I need to adapt some JavaScript code? Where?

stefaneidelloth avatar Apr 01 '22 10:04 stefaneidelloth

The appearance of the chart seems to be "hard coded" in JavaScript:

https://github.com/projectmesa/mesa-geo/blob/master/mesa_geo/visualization/templates/js/ChartModule.js

chart.data.labels.push(control.tick);

The global variable "control" and the tick values are defined in

https://github.com/projectmesa/mesa-geo/blob/f5dc628c3674c7faa42c3a4d2053d6cc69f6fa5e/mesa_geo/visualization/templates/js/runcontrol.js

var control = new MesaVisualizationControl();

stefaneidelloth avatar Apr 01 '22 10:04 stefaneidelloth

This is in fact related to mesa (for some reason the javascript code was just copied over). Would you like to ask over there?

Not sure if it's related but there's an open PR that might be of interest to you: https://github.com/projectmesa/mesa/pull/1139

wang-boyu avatar Apr 01 '22 14:04 wang-boyu

Issue transferred to mesa for advice

wang-boyu avatar Nov 24 '22 15:11 wang-boyu

I made #1540.

rht avatar Nov 30 '22 11:11 rht