Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#16994 closed defect (invalid)

Data Point Missing When Data Consist of One Record

Reported by: watermelontang Owned by: Eugene Lazutkin
Priority: undecided Milestone: tbd
Component: Charting Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:



I would like to ask about the data point.

This is my code.

<link rel="stylesheet" href="../dojo-release-1.7.2/dijit/themes/claro/claro.css">
<script src="../dojo-release-1.7.2/dojo/dojo.js"  data-dojo-config="async:true, isDebug: false"></script>
<script type="text/javascript">
			 // Require the basic chart class

			// Require the theme of our choosing
			// Charting plugins: 

			// 	We want to plot Lines 

			// Load the Legend, Tooltip, and Magnify classes
			//	We want to use Markers

			//	We'll use default x/y axes

			// Wait until the DOM is ready
		], function(ready,Chart, theme, LinesPlot, Legend, Tooltip, Magnify) {
					// Define the data
var chartData = [10000];
var chartData2 = [3000];
var chartData3 = [3000];

	// Create the chart within it's "holding" node
	var chart = new Chart("chartNode");

	// Set the theme

	// Add the only/default plot
	chart.addPlot("default", {
		type: "Lines",
		markers: true

	// Add axes
	chart.addAxis("y", { min: 5000, max: 30000, vertical: true, fixLower: "major", fixUpper: "major" });

	// Add the series of data
	chart.addSeries("Monthly Sales - 2010",chartData);
	chart.addSeries("Monthly Sales - 2009",chartData2);
	chart.addSeries("Monthly Sales - 2008",chartData3);

	var tip = new Tooltip(chart,"default");
							// Create the magnifier
							var mag = new Magnify(chart,"default");
							// Render the chart!
							// Create the legend
							var legend = new Legend({ chart: chart }, "legend");

<body class="claro">
		<div id="chartNode" style="width:auto;height:90%;"></div>
		<div id="legend"></div>


I have one one data for each line and the output is like one point for each line. At the bottom of the graph, it doesn't show the label for each line.

Is that a defect?

Thanks for your generous help.


Attachments (2)

Untitled.jpg (35.1 KB) - added by watermelontang 9 years ago.
Output Sample
Try1.jpg (38.7 KB) - added by watermelontang 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by watermelontang

Attachment: Untitled.jpg added

Output Sample

comment:1 Changed 9 years ago by cjolif

#17014 is a duplicate of this ticket.

comment:2 Changed 9 years ago by cjolif

Resolution: invalid
Status: newclosed

The x-axis can't really compute a min and max as you only a single data point. I think the right solution would be to set yourself the min and max on the x-axis just as you did for the y-axis. It should solve your problem.

comment:3 Changed 9 years ago by watermelontang


I've change according to your suggestion by adding a min and max value. But it doesn't help.

chart.addAxis("x",{ min: 3000, max: 10000});

Any other suggestion?

Thanks for your generous help.


Changed 9 years ago by watermelontang

Attachment: Try1.jpg added

comment:4 Changed 9 years ago by cjolif

I do see the labels on the x-axis now? To be honest I'm not sure what you are expecting. If you have picture of what you try to achieve maybe it will help.

Note: See TracTickets for help on using tickets.