#Apache eChart Data Range

15 messages · Page 1 of 1 (latest)

unreal scroll
#
option = {
  tooltip: {
    trigger: 'axis',
    axisPointer: { type: 'cross' }
  },
  xAxis: {
    name: 'Pledge',
    nameLocation: 'middle',
    nameTextStyle: {
        padding: 12
    }, 
    min: 0,
    max: 90000000,
    data: [0, 10000, 100000, 1000000, 90000000],
    type: 'log',
  },

  yAxis: {
    name: 'Expected Return',
    nameLocation: 'middle',
      nameTextStyle: {
        padding: 32
      },    
    axisLabel: {
      formatter: '{value}%'
    },
    type: 'value',
  },
  series: [
    {
      data: [0, 1, 2, 3, 4],
      type: 'line',
      color: '#43a047'
    },
  ],
}

I have the above options being passed into my chart. The documentation shows that xAxis.min and xAxis.max should define the total range of my xAxis, but the label is stuck showing 1 through 10 only. I want it to be fixed from 0 to 90 million.

Additionally, it doesn't even seem to be plotting my first point at all, which should be at (0,0). I can't figure out what is wrong using the docs. Any help would be appreciated.

young whale
#

Hi @unreal scroll, I’m Alexander Lill (not a bot!), a researcher at the University of Zurich. I’m trying to help people receive answers faster on Discord. If you are ok with me trying to help you, please read on, otherwise click the ⛔ symbol, and I will delete this message and apologize for the inconvenience.

Based on your question, I suggest the following links. Please click the emojis below each link to let me know if the link was helpful ✅ or not helpful ❌.

DM me if you have any questions. More info: #1063200184315674706

unreal scroll
#

The problem with using interval as-described in the first link is that I want it to be a logarithmic scale, not a flat value.
[0, 10000, 100000, 1000000, 90000000] roughly increases by a factor of 10 each time (except the first and last, to normalize where the data set will fall).

#

Second one doesn't use eCharts, but I played around with some of the attributes eCharts docs mention and had no success. It also doesn't help that the label is wrong too. The last point should be at (90000000,4) but the highest x-value is less than 10 on the chart.

#

Third one isn't relevant here either since the two data sets have the same number of elements (5 each).

young whale
#

@unreal scroll Even if my links above were not useful, I would be very thankful if you could fill a short <10 minute survey on your experience with the suggested links and your feedback (max. 10 mins). (After you solved your problem would be fine)

We would highly appreciate your feedback to help our research project. For your efforts, you can decide to be entered in a raffle for an Amazon gift card of USD 100 value (voluntary).

To participate in the survey, please answer the questions in the following link. Your responses will be treated confidentially.
https://uzhwwf.qualtrics.com/jfe/form/SV_1zWdrjjRfwFGXwa?ST=SO&CO=TS&CI=2849510

unreal scroll
unreal scroll
#

I was able to solve it. I need to include both sets of data in series and also not use 0 as an x-value.

const options = {
  tooltip: {
    trigger: 'axis',
    axisPointer: { type: 'cross' }
  },
  xAxis: {
    name: 'Pledge',
    nameLocation: 'middle',
    nameTextStyle: {
        padding: 12
    }, 
    min: 1,
    max: 90000000,
    type: 'log',
  },

  yAxis: {
    name: 'Expected Return',
    nameLocation: 'middle',
      nameTextStyle: {
        padding: 32
      },    
    axisLabel: {
      formatter: '{value}%'
    },
    type: 'value',
  },
  series: [
    {
      data: [[1,0], [10000,1], [100000,2], [1000000,3], [90000000,4]],
      type: 'line',
      color: '#43a047'
    },
  ],
}

export { options };```
#

!resolved

young whale
#

Congratulations! And please consider my survey if you can! 🙂

young whale
#

Really strange that it stops working when you put min: 0