Sponsored Content
Top Forums Programming Creating a line graph in jqplot Post 302629315 by figaro on Tuesday 24th of April 2012 01:07:21 PM
Old 04-24-2012
Creating a line graph in jqplot

I have a piece of code here that should create a line graph consisting of two lines. It will not render the lines and neither the dates on the x-axis. The y-axis is apparently already scaled for the y-values, so the data interpretation went correctly for at least some of the data.
Does anybody see an immediate solution to having the lines displayed as well as the dates along the x-axis?
Code:
<html>
<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
<link rel="stylesheet" type="text/css" href="../jquery.jqplot.css" />
<link rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />

<script type="text/javascript">
$(document).ready(function() {           
  var plot2 = $.jqplot('chart2', [source01, source02], {
    title: {
      text: 'Validation chart',
      show: true
    },
    axes: {
      xaxis: {
        renderer: $.jqplot.DateAxisRenderer,
        tickOptions: { formatString: '%e-%b-%Y' },
        min: "09-01-2008",
        max: "06-22-2009",
        tickInterval: "6 weeks",
      },
      y2axis: {
        tickOptions: { formatString: '%d' }
      }
    },
    seriesDefaults: {
	  lineWidth: 1,
	  markerOptions: { show: false }
	}
  });
});

source01 = [ 
['06/15/2009 16:00:00', 136.01],
['06/08/2009 16:00:00', 143.82],
['06/01/2009 16:00:00', 136.47],
['05/26/2009 16:00:00', 124.76],
['05/18/2009 16:00:00', 123.73],
['05/10/2009 16:00:00', 132.03]
];

source02 = [
['06/15/2009 16:00:00', 139.48],
['06/08/2009 16:00:00', 136.97],
['06/01/2009 16:00:00', 144.67],
['05/26/2009 16:00:00', 135.81],
['05/18/2009 16:00:00', 122.5],
['05/10/2009 16:00:00', 130.91]
];

</script>

<div id="chart2" style="width:400px;height:300px; "></div>
</html>

SOLVED: Requires the following additional file to work:

Code:
<script type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.min.js"></script>


Last edited by figaro; 04-24-2012 at 02:12 PM.. Reason: Solution offered
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating a line for printing

Hi All I need to create a report and need some help on the formating side. In this report, I gather information from 2 different files and produce the line. I was looking at having a variable for the full lenght of the line with spaces and using the substr to put the right fields in place. Is... (3 Replies)
Discussion started by: jhansrod
3 Replies

2. OS X (Apple)

creating a new profile from command line

Does any1 know how to preform such an operation on a mac? any help appreciated (2 Replies)
Discussion started by: cleansing_flame
2 Replies

3. UNIX for Dummies Questions & Answers

creating conditions for making a new line?

Basically I want to change this: a:b c:d:e f:g h:i:j k:l into a:b c d:e f:g h i:j k:l so like if there is two :'s in one line making the first into a new line. If anyone knows how to do this I would be very appreciative! (9 Replies)
Discussion started by: Audra
9 Replies

4. UNIX for Dummies Questions & Answers

Rewriting line with tabs creating problem

Hi I have an input file which have random file in between.I have to manipulate each line and replace the character from position 5-10 with XXXXXX. But when I am writing this to on output file the tabs in between gets converted to normal space. Input file : 14207531131040896334R108 ... (4 Replies)
Discussion started by: akashtcs
4 Replies

5. Shell Programming and Scripting

Creating a new line using awk?

Is there a way while using awk to print out lines, to create a new line after every line that is being displayed? (2 Replies)
Discussion started by: puttster
2 Replies

6. Programming

Creating area graphs in jqplot

How can area graphs be created in jqplot? Example can be seen here: dygraphs JavaScript Visualization Library In the example the line graphs and the grid are superimposed on the area graphs. I dont think it is supported out of the box for jqplot. I would normally do this with a double fill: -... (0 Replies)
Discussion started by: figaro
0 Replies

7. Shell Programming and Scripting

gnuplot flat line graph

Hi, I'm not able to find a solution because I cant find the exact keyword for this. I wanna make a graph like ive shown in the attachment. Could someone please share ideas on how to do this. Thanks! (3 Replies)
Discussion started by: jamie_123
3 Replies

8. Shell Programming and Scripting

Problem creating graph with gnuplot with time on x-axis

Let me start by saying I'm new to gnuplot and not very good at unix at all.. Anyway, I'm each minute measuring temperature and humidity and saves the last 60 readings along with time in a textfile, values_minute. The contents of the file is formatted like this: time temperature humidity ... (8 Replies)
Discussion started by: hakro807
8 Replies

9. Shell Programming and Scripting

Creating duplicate records from a single line

Hi All, I would like to create a 1 million duplicate records from a single fixed length row. Is there a simple way to create this quickly in unix. I am using korn shell on the AIX OS. For ex, 100234 XHYSDDS SDSD OUPUT (1 million rows) 100234 XHYSDDS SDSD . . . 100234 XHYSDDS SDSD... (5 Replies)
Discussion started by: saratha14
5 Replies

10. Shell Programming and Scripting

Creating a sequence of numbers in a line for 1000 files

Hi, I try to explain my problem , I have a file like this: aasdsaffsc23 scdsfsddvf46567 mionome0001.pdb asdsdvcxvds dsfdvcvc2324w What I need to do is to create 1000 files in which myname line listing a sequence of numbers from 0001 to 1000. So I want to have : nomefile0001.txt that must... (10 Replies)
Discussion started by: danyz84
10 Replies
graph(1)                                                           User Commands                                                          graph(1)

NAME
graph - draw a graph SYNOPSIS
graph [ -a spacing [start]] [-b] [-c string] [-g gridstyle] [-l label] [-m connectmode] [-s] [ -x [l] lower [ upper [spacing]]] [ -y [l] lower [ upper [spacing]]] [-h fraction] [-w fraction] [-r fraction] [-u fraction] [-t] ... DESCRIPTION
graph with no options takes pairs of numbers from the standard input as abscissaes and ordinates of a graph. Successive points are con- nected by straight lines. The standard output from graph contains plotting instructions suitable for input to plot(1B) or to the command lpr -g (see lpr(1B)). If the coordinates of a point are followed by a nonnumeric string, that string is printed as a label beginning on the point. Labels may be surrounded with quotes "...", in which case they may be empty or contain blanks and numbers; labels never contain NEWLINE characters. A legend indicating grid range is produced with a grid unless the -s option is present. OPTIONS
Each option is recognized as a separate argument. If a specified lower limit exceeds the upper limit, the axis is reversed. -a spacing[ start ] Supply abscissaes automatically (they are missing from the input); spacing is the spacing (default 1). start is the starting point for automatic abscissaes (default 0 or lower limit given by -x). -b Break (disconnect) the graph after each label in the input. -c string String is the default label for each point. -g gridstyle Gridstyle is the grid style: 0 no grid, 1 frame with ticks, 2 full grid (default). -l label label is label for graph. -m connectmode Mode (style) of connecting lines: 0 disconnected, 1 connected (default). Some devices give distin- guishable line styles for other small integers. -s Save screen, do not erase before plotting. -x [ l ] lower [ upper [ spacing ] ] If l is present, x axis is logarithmic. lower and upper are lower (and upper) x limits. spacing, if present, is grid spacing on x axis. Normally these quantities are determined automatically. -y [ l ] lower [ upper [ spacing ] ] If l is present, y axis is logarithmic. lower and upper are lower (and upper) y limits. spacing, if present, is grid spacing on y axis. Normally these quantities are determined automatically. -h fraction fraction of space for height. -w fraction fraction of space for width. -r fraction fraction of space to move right before plotting. -u fraction fraction of space to move up before plotting. -t Transpose horizontal and vertical axes. Option -x now applies to the vertical axis. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ SEE ALSO
lpr(1B), plot(1B), spline(1), plot(3PLOT), attributes(5) BUGS
graph stores all points internally and drops those for which there is no room. Segments that run out of bounds are dropped, not windowed. Logarithmic axes may not be reversed. SunOS 5.10 14 Sep 1992 graph(1)
All times are GMT -4. The time now is 02:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy