Hi,
I'm sorry if this should be really obvious but for some reason I can't figure it out. I have a button to launch the TChartEditor for a particular series. I am using the TreeView of editor and have hidden all of the tabs except for Series and themes. Two questions.
1) There doesn't seem to be a way to hide the themes tab. Is there a way to do this?
2) I can't find a way to have the particular series I want to edit already selected in the tree under the series node. It opens with the Series Node selected and then I have to expand it to click on the series. Is there a way to have the editor launch with the series I want to edit already selected?
Thanks!
SDE
Open TChartEditor on a particular series
Re: Open TChartEditor on a particular series
Hello,
This seems to work as you describe:
This seems to work as you describe:
Code: Select all
uses Series, TeeEditCha;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
ComboBox1.Clear;
for i:=0 to 5 do
begin
Chart1.AddSeries(TBarSeries).FillSampleValues;
ComboBox1.Items.Add('Series'+IntToStr(i+1));
end;
ComboBox1.ItemIndex:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var myEditor: TChartEditForm;
begin
myEditor:=TChartEditForm.Create(Self);
myEditor.Chart:=Chart1;
myEditor.CheckHelpFile;
TeeTranslateControl(myEditor,[myEditor.LBSeries]);
myEditor.TheHiddenTabs:=[{cetMain,}cetGeneral,cetAxis,cetTitles,cetLegend,cetPanel,cetPaging,cetWalls,
cet3D,cetSeriesGeneral,cetSeriesMarks,cetAllSeries,cetSeriesData,cetExport,
cetExportNative,cetTools,cetAnimations,cetPrintPreview];
try
myEditor.TheEditSeries:=Chart1[ComboBox1.ItemIndex];
myEditor.ShowModal;
finally
myEditor.Free;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Open TChartEditor on a particular series
Hi,
Thanks for that solution. I just ran it and it is almost perfect. It doesn't include the Format Tab which is the one I was really after. Is there a way to add that?
Also, I was going about it in a completely different way. In the code you provided, you use the object TChartEditForm from the Unit TeeEditCha, and I was using the object TChartEditor from the unit TeeEdit. In TChartEditor, there is no cetThemes enumerated type to hide the themes tab. Also, in TChartEditor there is no "TheEditSeries" property where you can set the selected series. Can you please explain the difference between TChartEditor and TChartEditForm and why someone may want to use one over the other?
SDE
Thanks for that solution. I just ran it and it is almost perfect. It doesn't include the Format Tab which is the one I was really after. Is there a way to add that?
Also, I was going about it in a completely different way. In the code you provided, you use the object TChartEditForm from the Unit TeeEditCha, and I was using the object TChartEditor from the unit TeeEdit. In TChartEditor, there is no cetThemes enumerated type to hide the themes tab. Also, in TChartEditor there is no "TheEditSeries" property where you can set the selected series. Can you please explain the difference between TChartEditor and TChartEditForm and why someone may want to use one over the other?
SDE
Re: Open TChartEditor on a particular series
Hello,
Or you can add the EditChar unit, that adds some editors for you.
The format tab is a different editor that depends on the series type. You can add the units for the series you are using to show this format tab. Ie: TeeBarEdit, TeeAreaEdit.sde wrote:Thanks for that solution. I just ran it and it is almost perfect. It doesn't include the Format Tab which is the one I was really after. Is there a way to add that?
Or you can add the EditChar unit, that adds some editors for you.
TChartEditor uses a TChartEditForm internally. So this is basically the same I did in my last post:sde wrote:Also, I was going about it in a completely different way. In the code you provided, you use the object TChartEditForm from the Unit TeeEditCha, and I was using the object TChartEditor from the unit TeeEdit. In TChartEditor, there is no cetThemes enumerated type to hide the themes tab. Also, in TChartEditor there is no "TheEditSeries" property where you can set the selected series. Can you please explain the difference between TChartEditor and TChartEditForm and why someone may want to use one over the other?
Code: Select all
uses TeeEdit;
procedure TForm1.Button2Click(Sender: TObject);
var myEditor: TChartEditor;
begin
myEditor:=TChartEditor.Create(Self);
myEditor.Chart:=Chart1;
myEditor.Series:=Chart1[ComboBox1.ItemIndex];
myEditor.TreeView:=true;
myEditor.HideTabs:=[cetGeneral,cetAxis,cetTitles,cetLegend,cetPanel,cetPaging,cetWalls,
cet3D,cetSeriesGeneral,cetSeriesMarks,cetAllSeries,cetSeriesData,cetExport,
cetExportNative,cetTools,cetAnimations,cetPrintPreview];
myEditor.Execute;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Open TChartEditor on a particular series
Hello,
Thank you for that code. It works great, but I'm still having an issue. I'm not sure what's going on and am hoping you can point me in the right direction.
When I run your code in a brand new project (created in Delphi 10), it works exactly as you describe. However, when I add it to my existing project (originally created in Delphi 7), I get a "Themes" tab in the TChartEditor (please see attached screenshot). So I figured it had to be something with my project settings. I've gone through and made all the same changes to the new project (disabled runtime themes, added styles, etc). I've compared the .dpr line by line and also the form code for the TChart. They are exactly the same. Yet my old project has the Themes tab and the new one doesn't. Do you know what triggers that themes tab to appear in the editor? I can't send you my project because it's huge and proprietary, so I need to troubleshoot through discussion only. What I need is to either prevent the Themes node from appearing in the tree view to begin with, or a way to hide the tab (there is no cetThemes...).
Thanks!
SDE
Thank you for that code. It works great, but I'm still having an issue. I'm not sure what's going on and am hoping you can point me in the right direction.
When I run your code in a brand new project (created in Delphi 10), it works exactly as you describe. However, when I add it to my existing project (originally created in Delphi 7), I get a "Themes" tab in the TChartEditor (please see attached screenshot). So I figured it had to be something with my project settings. I've gone through and made all the same changes to the new project (disabled runtime themes, added styles, etc). I've compared the .dpr line by line and also the form code for the TChart. They are exactly the same. Yet my old project has the Themes tab and the new one doesn't. Do you know what triggers that themes tab to appear in the editor? I can't send you my project because it's huge and proprietary, so I need to troubleshoot through discussion only. What I need is to either prevent the Themes node from appearing in the tree view to begin with, or a way to hide the tab (there is no cetThemes...).
Thanks!
SDE
- Attachments
-
- Screenshot.jpg (58.96 KiB) Viewed 13468 times
Re: Open TChartEditor on a particular series
Hello,
You may be loading TeeThemeEditor at some unit in your project. Note TeeThemeEditor is used in a few units: TeeChart, TeeChartPro, TeeDesignOptions and TeeEditPro. And some of these units are used in others, ie TeeChartActions and TeeComma units use TeeEditPro.
An option would be to call this in your project to clear any tab added by this method:
You may be loading TeeThemeEditor at some unit in your project. Note TeeThemeEditor is used in a few units: TeeChart, TeeChartPro, TeeDesignOptions and TeeEditPro. And some of these units are used in others, ie TeeChartActions and TeeComma units use TeeEditPro.
I think that's not an option because this tab is included by a method called in TeeThemeEditor initialization.sde wrote:(there is no cetThemes...).
An option would be to call this in your project to clear any tab added by this method:
Code: Select all
TeeOnShowEditor.Clear;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Open TChartEditor on a particular series
Yeray, you're a genius! I removed the TeeComma unit that I wasn't even using anymore and voila, the themes tab went away. Thanks so much for troubleshooting with me!
SDE
SDE
Re: Open TChartEditor on a particular series
Hello,
I'm glad to hear I was of any help!
I'm glad to hear I was of any help!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |