[Gambas-user] Multiple charts using gb.chart

Alberto Caballero alberto.kavan at ...626...
Fri Jun 28 13:13:39 CEST 2013


Ok Fabien,

I will try all of this. What I want to do is to show different charts
inside different tabs. Should I declare different Chart variables for each
chart?

I will update you ASAP.


2013/6/28 Fabien Bodard <gambas.fr at ...626...>

> Never resize the drawing area in its draw event !!!
>
> Use the form resize event or better learn how to use gambas arrangement
> properties. The last allow to do what you want without any code line.
> Le 28 juin 2013 13:06, "Fabien Bodard" <gambas.fr at ...626...> a écrit :
>
> > I think I don'treally understand what you want to do ...
> >
> > One tabstrip ... Multiple tabs and one chart object with different set of
> > data that change depend on the selected tab ?
> > Le 28 juin 2013 12:54, "Alberto Caballero" <alberto.kavan at ...626...> a
> > écrit :
> >
> >> Hi Fabien,
> >>
> >> Thanks for your support.
> >>
> >> Here you have the piece of code that manages the graph. For a new graph
> at
> >> a new DrawingArea, should I declare a new Chart variable? I think this
> did
> >> not work for me.
> >>
> >> Private Sub GenGraficaCaudales()
> >>
> >>   Dim i As Integer
> >>   Dim msg As String
> >>   Dim titles As New String[365]
> >>   Dim CaudalesArray As New Float[365]
> >>
> >>   For i = 0 To 364
> >>     msg = Str$(i)
> >>     titles[i] = msg
> >>   Next
> >>
> >>   CaudalesArray = pProyecto.GetCaudalesArray()
> >>   ChartCaudales.Headers.Values = titles
> >>   ChartCaudales.CountDataSets = 1
> >>
> >>   ChartCaudales[0].Text = "Caudales"
> >>   ChartCaudales[0].Values = CaudalesArray
> >>
> >>   ChartCaudales.Style = ChartStyle.Custom
> >>   ChartCaudales.Colors.values = [Color.blue, Color.Yellow]
> >>   ChartCaudales.Legend.Visible = True
> >>   ChartCaudales.Legend.Title = "Leyenda"
> >>
> >>   'Titulo de la Gráfica
> >>   ChartCaudales.Title.Text = "Curva de Caudales Clasificados"
> >>
> >>   ChartCaudales.XAxe.Step = 10
> >>   ChartCaudales.YAxe.MinValue = 0
> >>   ChartCaudales.YAxe.MaxValue = 15
> >>   ChartCaudales.Proportionnal = True
> >>
> >>   'Tipo de Gráfica
> >>   ChartCaudales.Type = ChartType.Lines
> >> End
> >>
> >> Public Sub DrawingArea1_Draw()
> >>
> >>   If (DrawOk = True) Then
> >>     ChartCaudales.Width = DrawingArea1.ClientHeight - 50
> >>     ChartCaudales.Height = DrawingArea1.ClientWidth - 50
> >>     ChartCaudales.Resize(880, 450)
> >>     ChartCaudales.Draw 'Muestra la Grafica
> >>   Endif
> >>
> >>
> >> End
> >>
> >>
> >> 2013/6/27 Fabien Bodard <gambas.fr at ...626...>
> >>
> >> > can you send me your project or a part of it that show the problem ?
> >> >
> >> >
> >> > 2013/6/27 Alberto Caballero <alberto.kavan at ...626...>
> >> >
> >> > > Hi all,
> >> > >
> >> > > I am trying to show multiple charts inside a TabView. I managed to
> >> show
> >> > > only one chart. I only get compilation errors or the new chart is
> not
> >> > > displayed. I tried to find something to help me in the internet, and
> >> even
> >> > > in this mailing list, but I was unable to find anything.
> >> > >
> >> > > Would you provide me any reference or an example to have a look?
> >> > >
> >> > > Thanks in advance,
> >> > >
> >> > > Alberto
> >> > >
> >> > >
> >> >
> >>
> ------------------------------------------------------------------------------
> >> > > This SF.net email is sponsored by Windows:
> >> > >
> >> > > Build for Windows Store.
> >> > >
> >> > > http://p.sf.net/sfu/windows-dev2dev
> >> > > _______________________________________________
> >> > > Gambas-user mailing list
> >> > > Gambas-user at lists.sourceforge.net
> >> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > Fabien Bodard
> >> >
> >> >
> >>
> ------------------------------------------------------------------------------
> >> > This SF.net email is sponsored by Windows:
> >> >
> >> > Build for Windows Store.
> >> >
> >> > http://p.sf.net/sfu/windows-dev2dev
> >> > _______________________________________________
> >> > Gambas-user mailing list
> >> > Gambas-user at lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> >
> >>
> >>
> ------------------------------------------------------------------------------
> >> This SF.net email is sponsored by Windows:
> >>
> >> Build for Windows Store.
> >>
> >> http://p.sf.net/sfu/windows-dev2dev
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list