Create a line chart based on fields values


(German Dario Alvarez) #1

I was checking the graph view documentation and examples, I created a simple charts.
I have a model with 5 fields, and static X axis values, the question is: Can I create a line chart in tryton that has X: 1,2,3 and Y: field1_value, field2_value, field_3_value ? Is is possible? or graph can’t be used for that.
thanks team.


(Cédric Krier) #2

You can have only one field on the x axis but any y you want.


(German Dario Alvarez) #3

I guess that it’s for plot multiple-series, but can I create a graph for a One2Many Field? Thanks for the quick answer @ced , This is the last question.


(Sergi Almacellas Abellana) #4

Yes, you should add the graph view on the One2Many field view_ids and the relation will be shown as graph.


(German Dario Alvarez) #5

Thanks Sergi !!
Definitely I’ll read about it and give it a try.


(German Dario Alvarez) #6

It worked! Thanks sergi again.
Just for the reference, my steps was:

  1. Create a graph type view on my model views.xml definition.
  2. Then create a inside a tree.xml view the call for One2ManyField like this:
    field colspan=“4” name=“one2many_field_name” view_ids=“module_name.tree_view_id,module_name.graph_view_id”

Thanks you all for your help, that was I was looking for. a line chart view for One2Many field.