jsreport / jsreport-docx

jsreport recipe rendering word docx
MIT License
10 stars 3 forks source link

Data format to use custom error bar chart #30

Closed iamanoopmk closed 3 years ago

iamanoopmk commented 3 years ago

I have created an example playground to illustrate what I am trying to achieve

https://playground.jsreport.net/w/anon/nOWwqnRO

Basically, I want to render a line chart with custom error bar values. In docx I can do this by providing refs to custom list of positive and negative data as I have done in the template. But, how do I pass this list when jsreport is trying to render the same chart.

Could you please help me with this.

bjrmatos commented 3 years ago

hi!

unfortunately generating a chart with the error bar is not supported right now, we will try to add those features within a month, I think I have enough information for the implementation so I will reply here when it is ready for a test

bjrmatos commented 3 years ago

this is implemented in master, the data format for the error bars is this

const datasets = [{
      label: 'Data',
      data: [4.3, 2.5, 3.5, 4.5],
      // 0 index is for positive value and 1 index is for the negative value
      dataErrors: [[6, 3], [3, 2], [7, 2], [3, 1]]
    }]

we expect dataErrors to be filled with an array, each item should be also an array that should contain two items, the first is the positive value and the second is the negative value