On Apr 17, 2016, at 8:23 PM, Russell Thomas <[log in to unmask]> wrote:
> Currently, using the Console "Model" tab and inspectors for data, the bar and pie chart values ("y axis" in bar chart) is generated from *counts* of the Objects[ ].
> I suggest adding a new feature to produce bar and pie charts from data, where each datum is a pair: label (String) and value (double). I have implemented this using the code below, but it would be nice if this were added to the existing classes rather than as a separate chart type ("Make Bar Chart from Values")
0. Okay I gotta think about this; I had put the pause button on inspecting pairs.
One reason I (for the moment) stuck to only inspecting collections or arrays of objects was that Inspectors are most commonly used to inspect existing data from a model, that is, data that's designed for the simulation rather than customized for visualization purposes. I was hesitant to add custom classes like BarChartDatum. Still wondering if there is any standard class or interface we could use with both a double and a String (probably not). Also it should probably also support Maps.
1. I'm confused by your implementation approach: BarCharts and PieCharts already can add and update series in the form of a String and a double. Is there a reason you didn't use that facility to build your custom inspector? It would seem to be much easier to do that.