473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

ZedGraph ASPX VB

I am trying to use ZedGraph and can succesfully create a pretty nice
graph when I program put all the data directly into the control. Of
course, what I need to do is generate the graph dynamically based on
the information in a database. Since ZedGraph does not seem to handle
databinding, I figured I would just read through a recordset and assign
the point pairs. My first step, after which it should be easy, has
been to simply try to modify the graph via code-behind. I have had no
luck doing this and can't find anything in the samples. My code behind
code is as follows:

Any one have any experince with this?

'================================================= ===========================
'ZedGraph Class Library - A Flexible Charting Library for .Net
'Copyright (C) 2005 John Champion and Jerry Vos
'
'This library is free software; you can redistribute it and/or
'modify it under the terms of the GNU Lesser General Public
'License as published by the Free Software Foundation; either
'version 2.1 of the License, or (at your option) any later version.
'
'This library is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
'Lesser General Public License for more details.
'
'You should have received a copy of the GNU Lesser General Public
'License along with this library; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
'================================================= ============================
Imports ZedGraph.ZedGraphWeb
Imports ZedGraph
Public Class graph
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents ZedGraphWeb2 As ZedGraph.ZedGraphWeb
'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub ZedGraphWeb2_RenderGraph(ByVal g As
System.Drawing.Graphics, ByVal mpane As ZedGraph.MasterPane) Handles
ZedGraphWeb2.RenderGraph

Dim list1 As PointPairList
list1.Add(-50, -50)
list1.Add(100, 45)
list1.Add(15, 32)
Dim mycurve2 As LineItem
ZedGraphWeb2.Visible = False

mpane(0).CurveList.Clear()
mpane(1).CurveList.Clear()
mpane(2).CurveList.Clear()
mpane(0).AddCurve("Ryan's Line", list1, Color.BlueViolet,
SymbolType.Diamond)

mpane(0).CurveList(0).Color = Color.BlueViolet
mpane(0).CurveList(0).IsVisible = True

mpane(0).CurveList(0).Draw(g, mpane(0), 0, 0)
Dim mycurve As CurveItem
' mpane(0).CurveList.Add(mycurve)
' mpane(0).CurveList(0).AddPoint(0, 1)
' mpane(0).CurveList(0).AddPoint(4, 6)
' mpane(0).CurveList(0).AddPoint(24, 42)
' mpane(0).CurveList(0).AddPoint(-15, 25)
mpane(0).AxisChange(g)

mpane(0).Draw(g)
ZedGraphWeb2.Draw(True)
ZedGraph.ZedGraphWeb.RenderDemo(g, mpane(0))
End Sub
End Class


The control is as follows:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="graph.aspx.vb" Inherits="ZGBasic.graph"%>
<%@ Register TagPrefix="zgw" Namespace="ZedGraph" Assembly="ZedGraph"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>graph</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<zgw:zedgraphweb id="ZedGraphWeb2" runat="server" AxisChanged="True"
ClusterScaleWidth="1" IsAxisRectAuto="True"
MarginBottom="10" LineType="Normal" IsShowTitle="True"
OutputFormat="Jpeg" CacheDuration="0"
MarginTop="10" MarginRight="10" IsIgnoreMissing="False"
IsIgnoreInitial="False" MinClusterGap="1"
BarType="Cluster" PaneCount="1" MinBarGap="0.2" BaseDimension="8"
IsPenWidthScaled="False" MarginLeft="10"
IsFontsScaled="True" PaneLayout="SquareRowPreferred" BarBase="X"
EnableViewState="False">
<AxisRect Y="0" Height="0" Width="0" X="0"></AxisRect>
<PieRect Y="0" Height="0" Width="0" X="0"></PieRect>
<FontSpec Size="16" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="0" FontColor="Black"
StringAlignment="Center" IsBold="True">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</FontSpec>
<Y2Axis IsOmitMag="False" Max="0" MinGrace="0.1" GridPenWidth="1"
MinSpace="0" CrossAuto="False"
IsShowGrid="False" IsUseTenPower="False" MinorGridColor="Gray"
MinorGridDashOff="10"
MaxAuto="True" MinorGridPenWidth="1" ScaleFormatAuto="False"
IsReverse="False" IsMinorTic="True"
IsTic="True" IsMinorInsideTic="True" Cross="0"
IsTicsBetweenLabels="True" ScaleMag="0"
IsOppositeTic="True" TicPenWidth="1" GridDashOff="5"
IsShowMinorGrid="False" MinAuto="True"
Type="Linear" IsInsideTic="True" MinorGridDashOn="1"
MinorTicSize="2.5" IsVisible="False"
ScaleAlign="Center" MaxGrace="0.1" Color="Black" Min="0"
IsShowTitle="True" ScaleMagAuto="True"
IsPreventLabelOverlap="False" IsMinorOppositeTic="True"
ScaleFormat="g" StepAuto="True"
MinorStepAuto="True" TicSize="5" IsZeroLine="True" GridDashOn="1"
GridColor="Black"
Title="">
<ScaleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="-90" FontColor="Black"
StringAlignment="Center" IsBold="False">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</ScaleFontSpec>
<TitleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="0" FontColor="Black"
StringAlignment="Center" IsBold="True">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</TitleFontSpec>
</Y2Axis>
<XAxis IsOmitMag="False" Max="0" MinGrace="0.1" GridPenWidth="1"
MinSpace="0" CrossAuto="False"
IsShowGrid="False" IsUseTenPower="False" MinorGridColor="Gray"
MinorGridDashOff="10"
MaxAuto="True" MinorGridPenWidth="1" ScaleFormatAuto="False"
IsReverse="False" IsMinorTic="True"
IsTic="True" IsMinorInsideTic="True" Cross="0"
IsTicsBetweenLabels="True" ScaleMag="0"
IsOppositeTic="True" TicPenWidth="1" GridDashOff="5"
IsShowMinorGrid="False" MinAuto="True"
Type="Linear" IsInsideTic="True" MinorGridDashOn="1"
MinorTicSize="2.5" IsVisible="True"
ScaleAlign="Center" MaxGrace="0.1" Color="Black" Min="0"
IsShowTitle="True" ScaleMagAuto="True"
IsPreventLabelOverlap="False" IsMinorOppositeTic="True"
ScaleFormat="g" StepAuto="True"
MinorStepAuto="True" TicSize="5" IsZeroLine="False" GridDashOn="1"
GridColor="Black"
Title="">
<ScaleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="0" FontColor="Black"
StringAlignment="Center" IsBold="False">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</ScaleFontSpec>
<TitleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="0" FontColor="Black"
StringAlignment="Center" IsBold="True">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</TitleFontSpec>
</XAxis>
<Legend IsHStack="True" Position="Top" IsVisible="True">
<Fill RangeMax="0" Type="Brush" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Rect Y="0" Height="0" Width="0" X="0"></Rect>
<Border IsVisible="True" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
<FontSpec Size="12" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="0" FontColor="Black"
StringAlignment="Center" IsBold="False">
<Fill RangeMax="0" Type="Solid" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</FontSpec>
<Location CoordinateFrame="AxisFraction" Height="0" AlignH="Left"
X1="0" Y1="0" X="0" Y="0"
Width="0" AlignV="Center">
<BottomRight Y="0" X="0"></BottomRight>
<Rect Y="0" Height="0" Width="0" X="0"></Rect>
<TopLeft Y="0" X="0"></TopLeft>
</Location>
</Legend>
<AxisBorder IsVisible="True" PenWidth="1" InflateFactor="0"
Color="Black"></AxisBorder>
<AxisFill RangeMax="0" Type="Brush" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></AxisFill>
<PaneFill RangeMax="0" Type="Solid" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></PaneFill>
<PaneBorder IsVisible="True" PenWidth="1" InflateFactor="0"
Color="Black"></PaneBorder>
<CurveList>
<zgw:ZedGraphWebLineItem DataMember="" IsLegendLabelVisible="True"
StepType="NonStep" Label="Hi" SmoothTension="0.5"
IsSmooth="False" Color="0, 0, 192" Width="1" Style="Solid"
IsY2Axis="False" IsVisible="True">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="Red" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Points>
<zgw:ZedGraphWebPointPair Y="17" Z="0"
X="-6"></zgw:ZedGraphWebPointPair>
<zgw:ZedGraphWebPointPair Y="0" Z="0"
X="0"></zgw:ZedGraphWebPointPair>
<zgw:ZedGraphWebPointPair Y="16" Z="0"
X="1"></zgw:ZedGraphWebPointPair>
<zgw:ZedGraphWebPointPair Y="24" Z="0"
X="2"></zgw:ZedGraphWebPointPair>
</Points>
<Symbol IsVisible="True" SymbolType="Square" Size="7">
<Border IsVisible="True" PenWidth="1" InflateFactor="0"
Color="Red"></Border>
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="Red" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
</Symbol>
</zgw:ZedGraphWebLineItem>
</CurveList>
<YAxis IsOmitMag="False" Max="0" MinGrace="0.1" GridPenWidth="1"
MinSpace="0" CrossAuto="False"
IsShowGrid="False" IsUseTenPower="False" MinorGridColor="Gray"
MinorGridDashOff="10"
MaxAuto="True" MinorGridPenWidth="1" ScaleFormatAuto="False"
IsReverse="False" IsMinorTic="True"
IsTic="True" IsMinorInsideTic="True" Cross="0"
IsTicsBetweenLabels="True" ScaleMag="0"
IsOppositeTic="True" TicPenWidth="1" GridDashOff="5"
IsShowMinorGrid="False" MinAuto="True"
Type="Linear" IsInsideTic="True" MinorGridDashOn="1"
MinorTicSize="2.5" IsVisible="True"
ScaleAlign="Center" MaxGrace="0.1" Color="Black" Min="0"
IsShowTitle="True" ScaleMagAuto="True"
IsPreventLabelOverlap="False" IsMinorOppositeTic="True"
ScaleFormat="g" StepAuto="True"
MinorStepAuto="True" TicSize="5" IsZeroLine="True" GridDashOn="1"
GridColor="Black"
Title="">
<ScaleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="90" FontColor="Black"
StringAlignment="Center" IsBold="False">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</ScaleFontSpec>
<TitleFontSpec Size="14" IsUnderline="False" IsItalic="False"
Family="Arial" Angle="-180" FontColor="Black"
StringAlignment="Center" IsBold="True">
<Fill RangeMax="0" Type="None" AlignH="Center" IsScaled="True"
Color="White" RangeMin="0"
IsVisible="True" AlignV="Center"></Fill>
<Border IsVisible="False" PenWidth="1" InflateFactor="0"
Color="Black"></Border>
</TitleFontSpec>
</YAxis>
</zgw:zedgraphweb></form>
</body>
</HTML>

Jan 13 '06 #1
0 7122

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
1
by: Jerry Tovar | last post by:
I am using .Net 2003 on a XPPro running IIS. I am unable to view any of my ASPX webforms in a browser unless I modify the .ASPX file and replace Codebehind="employee.aspx.cs" with...
3
by: Tom | last post by:
Hi, I have an index.aspx page which includes top.aspx, left.aspx, main.aspx and bottom.aspx. In the left.aspx, there is a login web control - login.ascx. It keeps session of username and role...
6
by: John Lau | last post by:
Hi, I am looking at the MS KB Article 306355: HOW TO: Create Custom Error Reporting Pages in ASP.NET by Using Visual C# .NET This article describes how to redirect errors to a custom html...
3
by: DavidS | last post by:
Have parent.aspx from which I open Driver.aspx form via button on parent.aspx. When I first open the modal dialog, the driver.aspx Page_Load function is called. After I close the dialog, then...
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
2
by: WJ | last post by:
I have three ASPX pages: 1. "WebForm1.aspx" is interactive, responsible for calling a web site (https://www.payMe.com) with $$$. It is working fine. 2. "WebForm2.aspx" is non-interactive, a...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
24
by: John Rivers | last post by:
ASPX which means ASPX pages, the code-behind concept, User Controls, Web Controls etc. is very poorly designed and makes it extremely hard to develop professional quality web applications. ASPX...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.