can we store/restore the graph settings such as font,titles

TeeChart for ActiveX, COM and ASP
Post Reply
Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

can we store/restore the graph settings such as font,titles

Post by Aravind » Wed Mar 29, 2006 10:12 am

Hi


I have created graph using ado recordset and drawn a bar graph ,in my application there is a option to change to any type of graph for the same record set and also chart editor option is given to user to change the parameters such as titles, fonts, color , scaling, zooming percentage ...

when we insert the filter value in the recordset and invoke the same graph , all settings are restored ......

1.Is there any way to store all the settings of the graph apart from the data and invoke back the settings for the new query/recordset ?

2.Can i manually plot the axis and create the range of the axis ....? if yes then could you provide me help on plotting...


3. i created a stacked graph and have changed stacked property to stacked 100% , now i change the graph type to bar and move back to stacked graph , my setting is gone and stacked property is set back intial... is this bug in the app ? or any way to hold the property values

pls advise on this asap

thanks & regards
aravind

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Mar 29, 2006 11:09 am

Hi Aravind,

Please find below the answers to your questions:
1.Is there any way to store all the settings of the graph apart from the data and invoke back the settings for the new query/recordset ?
You can store and retrieve all TeeChart settings and data (optional). However, datasources are not stored when exporting charts. For more information on that please read Tutorial 12 - Exporting and Importing Charts. You'll find the tutorials at TeeChart's program group.

2.Can i manually plot the axis and create the range of the axis ....? if yes then could you provide me help on plotting...


You can do it manually by custom drawing on TeeChart's canvas but I'd strongly suggest you to use the provided axes methods and properties which let you control almost everything about axes. A good read which covers many of axes possibilities is Tutorial 4 - Axis Control.
3. i created a stacked graph and have changed stacked property to stacked 100% , now i change the graph type to bar and move back to stacked graph , my setting is gone and stacked property is set back intial... is this bug in the app ? or any way to hold the property values


This is as-designed. For example, if you use line series being stacked and change them to bar series, the stacking property is not the same for both series styles. For line series it is Stacked while for bar is MultiBar. The stacking possibilities are different as well and this depends on each series style as some of them don't support stacking as it wouldn't make much sense.

A solution for that would be using TeeChart's OnAfterDraw event or TeeCommander's OnEditedChart to check wether if the series type has change and if so manually check previous style stacking and set new series style stacking accordingly. It would be something like:

Dim ls As ECustomSeriesStack

Code: Select all

Private Sub Form_Load()
    TeeCommander1.Chart = TChart1
    
    For i = 0 To TChart1.SeriesCount - 1
        TChart1.Series(i).FillSampleValues 10
        TChart1.Series(i).asLine.Stacked = cssStack
    Next
    
    ls = TChart1.Series(0).asLine.Stacked
End Sub

Private Sub TeeCommander1_OnEditedChart()
    For i = 0 To TChart1.SeriesCount - 1
        
        If (TChart1.Series(i).SeriesType = scBar) Then
            
            If (ls = cssStack) Then
                TChart1.Series(i).asBar.MultiBar = mbStacked
            Else
                If (ls = cssStack100) Then
                    TChart1.Series(i).asBar.MultiBar = mbStacked100
                End If
            End If
            
        End If
        
    Next
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

still not getting

Post by Aravind » Wed Mar 29, 2006 12:21 pm

i have created stacked bar graph , saving the format with property for multibar stacked =100% with out data and reload the format and push the data in the graph , multibar stacked value changed back , titles and axis title are working fine .

( same stacked bar graph with property value for multibar stack is stacked 100% )

here i am not changing any graph type , i have just storing the format , reloading the format and pushing the new data in .

pls advise me

thanks and regards
aravind

Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

i want to read the value of mulitbar

Post by Aravind » Wed Mar 29, 2006 12:32 pm

how can i read the value of multibar when my graph is stacked bar ..
here is the code i am using

Chart.Series(i).asHorizBar.MultiBar

it gives me error as invalid cast type


pls advise me


thanks & regards
aravind

Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

i got the way to read the stack-thanks earlier sample

Post by Aravind » Wed Mar 29, 2006 12:42 pm

i got the way to read the stack-thanks earlier sample

thx
aravind

Post Reply