A new RGraph feature is the clipping extension, introduced in version 6.17 of RGraph. This new addition to RGraph allows you to easily restrict the drawing to a certain part of the canvas making it very easy to combine charts - for example different colored Line charts like the example shown here.

The clipping option can be one of multiple formats so you can easily restrict the drawing on the canvas to a shape, half of the canvas, a percentage of the scale (for scaled charts eg Bar, Line, Scatter) or a specific scale value.

[No canvas support]>

Parameter for creation of chart

1. Line Chart
{rgraph title="Line Chart using  Clipping Option"  type="Line"  width="700" height="350" backgroundImage="null" data="4,10,10,3,2,4,-5,-4,-5,-6,-1,9,1,2,3,5,7,4,-2,-2,6,2,3,4,4,8,6,2,3,5,1,4,9,5,6,4,-3,-8,-10,-5,6,4,5,1,2,3,4,6" textSize="13"  xaxisPosition="center"  backgroundGridHlinesCount="10" backgroundGridVlines="false" backgroundGridBorder="false"  shadow="false"  linewidth="2" colors="red" filled="true" filledColors="rgba(255,128,128,0.25)"  marginInner="15" spline="true"  clip="scale:0-max" xaxisTickmarksCount="12"}cvs{/rgraph}
2. Line Chart
{rgraph  type="Line"  combine_chart="1" width="700" height="350"
data="4,10,10,3,2,4,-5,-4,-5,-6,-1,9,1,2,3,5,7,4,-2,-2,6,2,3,4,4,8,6,2,3,5,1,4,9,5,6,4,-3,-8,-10,-5,6,4,5,1,2,3,4,6" textSize="13"  xaxisPosition="center"   backgroundGridHlinesCount="10"  backgroundGridVlines="false" backgroundGridBorder="false"  shadow="false"  linewidth="2"  filled="true"  marginInner="15" spline="true"  xaxisTickmarksCount="12" colors="#990"  filledColors="rgba(128,128,255,0.25)"  clip="scale: bottomhalf"}cvs{/rgraph}

 

Important: If you want to test this sample via copy/paste, ensure that you paste with option "paste as plain text" otherwise imbedded html-codes may invalidate your input.
go back...

Visitors

Today: 47
Yesterday: 77
This Week: 466
Last Week: 619
This Month: 1,684
Last Month: 1,969
This Year: 10,859
Total: 243,452
0243452
Germany 31.5% Germany
USA 22.4% USA
France 3.3% France
Italy 2.7% Italy
Indonesia 2.1% Indonesia
Poland 2.0% Poland

Total:

209

Countries

Weather

Weather in Ashburn

22nd June, 2024 - 14:48
Scattered Clouds
97°F 93°F min 101°F max
5:44 20:39
Humidity: 44 %
Wind: 8.1 mph North-West
Pressure: 1,013 hPa
Visibility: 32,808 ft
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.