Opened 6 years ago

Closed 6 years ago

Last modified 6 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:

Description

Hi,

I would like to ask about the data point.

This is my code.

<html>
<head>
<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(["dojo/ready",
			 // Require the basic chart class
			"dojox/charting/Chart",

			// Require the theme of our choosing
			"dojox/charting/themes/Claro",
			
			// Charting plugins: 

			// 	We want to plot Lines 
			"dojox/charting/plot2d/Lines",

			// Load the Legend, Tooltip, and Magnify classes
			"dojox/charting/widget/Legend",
			"dojox/charting/action2d/Tooltip",
			"dojox/charting/action2d/Magnify",
			
			//	We want to use Markers
			"dojox/charting/plot2d/Markers",

			//	We'll use default x/y axes
			"dojox/charting/axis2d/Default",

			// Wait until the DOM is ready
			"dojo/domReady!"
		], function(ready,Chart, theme, LinesPlot, Legend, Tooltip, Magnify) {
		
			   ready(function(){
					// 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
	chart.setTheme(dojox.charting.themes.Claro);

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

	// Add axes
	chart.addAxis("x");
	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!
							chart.render();
							
							// Create the legend
							var legend = new Legend({ chart: chart }, "legend");
	
			   });
		})



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

</body>
</html>

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.

Elaine

Attachments (2)

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

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by watermelontang

Attachment: Untitled.jpg added

Output Sample

comment:1 Changed 6 years ago by cjolif

#17014 is a duplicate of this ticket.

comment:2 Changed 6 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 6 years ago by watermelontang

Hi,

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.

Elaine.

Changed 6 years ago by watermelontang

Attachment: Try1.jpg added

comment:4 Changed 6 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.