question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Y axis: define low and high point of data

See original GitHub issue

Hello guys! I hope you’re all well, I have an issue with the line chart. Is there a way to define the Y axis lower value to 0, even thought the values entered are all in “100”?And is there a way to define the Y axis higher value to 100 aswell? How can I do that?

by the way, thank you for making this library, I love it! Is there more documentation?

Thanks in advance, Myr * g4

the datasets

    datasets: [
      {
        title: "Finiquito", color: "green",
        values: [100, 100, 100, 100, 100, 100]
      }
    ]

Here comes the whole code:



	  let linedatatest = {
	    labels: ["May", "Jun", "Jul", "Aug", "Sep", "Oct"],

	    datasets: [
	      {
	        title: "Finiquito", color: "green",
	        values: [0, 100, 100, 100, 100, 100]
	      }
	    ]
	    
	  };

	  let linecharttest = new Chart({
	    parent: "#linedatatest", // or a DOM element
	    title: "Linedata",
	    data: linedatatest,
	    type: 'line', // or 'line', 'scatter', 'pie', 'percentage'
	    width: 720,
	    height: 230,
	    format_tooltip_x: d => (d + '').toUpperCase(),
	    format_tooltip_y: d => d + ' pts'
	  });

Frappé Charts version: https://unpkg.com/frappe-charts@0.0.6/dist/frappe-charts.min.iife.js

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

9reactions
kepanocommented, Apr 22, 2018

Being able to set the minimum, maximum and increment values for the Y axis would be very helpful. I think it would help solve this issue as well as #100 and #127.

1reaction
rojakcodercommented, Mar 23, 2018

My workaround is to put an empty y-marker.

let linedatatest = {
    labels: ["May", "Jun", "Jul", "Aug", "Sep", "Oct"],
    datasets: [
        {
            title: "Finiquito", color: "green",
            values: [0, 100, 100, 100, 100, 100]
        }
    ],
    yMarkers: [
        {
            label: '',
            value: 0,
            type: 'solid'
        }
    ]
};

It works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Highlight High and Low Points in an Excel Chart [The Right Way]
Want to dynamically highlight high and low points in an Excel chart? This article shows you how so that you can better tell...
Read more >
Graph Terminology | Axis, Range & Scale - Study.com
The range of data (on a graph) is the difference between the highest and lowest values for data in the direction of the...
Read more >
Change the scale of the vertical (value) axis in a chart
By default, Microsoft Office Excel determines the minimum and maximum scale values of the vertical (value) axis, also known as the y axis,...
Read more >
Chart Elements
On category axes, axis labels are displayed between ticks. Label lines are lines leading from a data point to its data label. High-low...
Read more >
Graphing Tips
Each axis needs a scale to show the range of the data on that axis. The low end of the scale may be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found