react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

Fixed min/max Y label value in BarChart and LineChart

Open k-yokoishi opened this issue 5 years ago • 8 comments

Thank you for providing the great chart kit!

I think it is better to provide a way to configure the Y label value because the UI is not good if all values are the same as follows.

all-same

Thus I'd like to configure the min/max Y label value in BarChart and LineChart like this. (It's referencing Google Charts)

<BarChart
  style={graphStyle}
  data={data}
  width={screenWidth}
  height={220}
  chartConfig={chartConfig}
  maxValue={500} # new props
  minValue={0}   # new props
/>

Thanks.

k-yokoishi avatar Mar 21 '19 06:03 k-yokoishi

Is this option available?

caio-ribeiro-pereira avatar Apr 12 '19 18:04 caio-ribeiro-pereira

This option is not available, but if someone made a PR for this, that would be great!

Hermanya avatar Apr 12 '19 20:04 Hermanya

Hi everyone, please any news on this feature ?

AhmedCoolProjects avatar Aug 24 '21 04:08 AhmedCoolProjects

<BarChart
  style={graphStyle}
  data={data}
  width={screenWidth}
  height={220}
  chartConfig={chartConfig}
  fromNumber={500} 
  fromZero={true} 
/>

the prop fromNumber seems to work at-least on bar charts as a maximum value

andrewjudd1 avatar Apr 21 '22 05:04 andrewjudd1

<BarChart
  style={graphStyle}
  data={data}
  width={screenWidth}
  height={220}
  chartConfig={chartConfig}
  fromNumber={500} 
  fromZero={true} 
/>

the prop fromNumber seems to work at-least on bar charts as a maximum value

This is sufficient enough

kabonKoda avatar Jun 05 '22 13:06 kabonKoda

A simple Given Solution To Set Min & Max Values With Hidden Dots

d <LineChart data={{ labels: xAxis, datasets: [ { data: yAxis, }, { data:[0], // Set Min withDots: false, // Hide Dots }, { data:[10], // Set Max withDots: false, // Hide Dots } ] }}

TalhaAbid1 avatar Feb 10 '23 15:02 TalhaAbid1

A simple Given Solution To Set Min & Max Values With Hidden Dots

d <LineChart data={{ labels: xAxis, datasets: [ { data: yAxis, }, { data:[0], // Set Min withDots: false, // Hide Dots }, { data:[10], // Set Max withDots: false, // Hide Dots } ] }}

Genius!

josh-thompson13 avatar Apr 19 '23 03:04 josh-thompson13

is there any possible

A simple Given Solution To Set Min & Max Values With Hidden Dots

d <LineChart data={{ labels: xAxis, datasets: [ { data: yAxis, }, { data:[0], // Set Min withDots: false, // Hide Dots }, { data:[10], // Set Max withDots: false, // Hide Dots } ] }}

is there any possibility for format like [20,30,40,50,60] ?

Srinivas2445 avatar Apr 03 '24 08:04 Srinivas2445