Problem:
we save all settings for the Chart with the function SaveChartToStream
The new default palette is Opera
Open the Setup and select as palette Standard or TeeChart
>> No entry in the saved configuration for the slected palette
>> Is it not possible to save the standard palette setting
We can't change the registry entries at the customer side to something else, moth of our customers do not have admin rights!
We are probing around with the palette problem since quite a while, please try to fix this as soon as possible.
Thanks in advance.
>>EDIT
When choosing Palette Standard or TChart >>entry ColorPaletteIndex in the stream is missing
Reopening the Chart LINE 2312 in CHART.PAS sets it to ColorPaletteIndex 13 if there is no Registry entry SetColorPaletteIndex(TeeReadIntegerOption('DefaultPalette',13));
Changing this line in SetColorPaletteIndex(0); everything works fine
Save Palette in SaveChartToStream does not work
Re: Save Palette in SaveChartToStream does not work
Hi,
Then, you set the default palette to be the Classic TeeChart palette, and now it works as you wish, isn't it?
Then, you set the default palette to be the Classic TeeChart palette, and now it works as you wish, isn't it?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Save Palette in SaveChartToStream does not work
Hi, YerayYeray wrote:Hi,
Then, you set the default palette to be the Classic TeeChart palette, and now it works as you wish, isn't it?
please try the following test:
no registry entry
Open the chart editor, select Opera, save settings using SaveChartToStream
Reopen Chart editor>>OPERA is selected , select TeeChart, save using SaveChartToStrem
Reopen Chart Editor >> OPERA is selected
There is no way to save the old default or tchart palette.
Please give it a try.
Thanks in advance
Re: Save Palette in SaveChartToStream does not work
Hello,
I think I understood the problem.
This line in Chart.pas:
Should be
So the TeeNewChartPalette can be used when the Palette isn't found in the registry, instead of forcing the 13, OperaPalette.
We're investigating if this is the best way to go and we'll be back to you asap.
I think I understood the problem.
This line in Chart.pas:
Code: Select all
SetColorPaletteIndex(TeeReadIntegerOption('DefaultPalette',13));
Code: Select all
SetColorPaletteIndex(TeeReadIntegerOption('DefaultPalette',TeeNewChartPalette));
We're investigating if this is the best way to go and we'll be back to you asap.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Save Palette in SaveChartToStream does not work
Hello again,
I initially thought the intention of this was to define the palette for a new chart creation. To do something like in the "Options..." option in the contextual menu at design time, in the "New Chart" tab, where you can select the palette for the new charts that will be created.
This makes sense with the SetColorPaletteIndex call in Chart.pas mentioned in my last reply.
However, I don't see how this relates with the SaveToStream function. Note SaveChartToStream function is used by SaveChartToChart, and saving a chart to a file seems to save the ColorPalette correctly; running the following code produces a test.txt file where I can find the "ColorPaletteIndex = 0" property correctly serialized, so this is not the problem.
I can import in a chart where the defaultpalette is Opera and in a machine where the DefaultPalette key isn't present in the registry:
Furthermore, following the instructions here, I don't get the same result than you:
- Create a new project, D7 + TeeChart v2012.07.
- Add a TChart to the form.
- Backup and remove the "DefaultPalette" key in the registry at "HKEY_CURRENT_USER\Software\Steema Software\TeeChart Pro\Editor".
- Open the Themes tab in the chart editor. Check the palette selected is Opera.
- Place a button, make it use the following code and execute the application and the button:
If I open the generated text.txt I see the line "ColorPaletteIndex = 13".
- Stop the application.
- Open the Themes tab in the chart editor. Change the palette from Opera to TeeChart.
- Execute the application and the button again. If I open the generated text.txt I see the line "ColorPaletteIndex = 0".
- Open the Themes tab in the chart editor. According to your instructions, you see the Opera palette is selected. However, I see the Default palette selected.
So this seems to work fine for me here. And I've also checked the registry and the "DefaultPalette" entry isn't present.
Do you see any relevant step I could miss?
I initially thought the intention of this was to define the palette for a new chart creation. To do something like in the "Options..." option in the contextual menu at design time, in the "New Chart" tab, where you can select the palette for the new charts that will be created.
This makes sense with the SetColorPaletteIndex call in Chart.pas mentioned in my last reply.
However, I don't see how this relates with the SaveToStream function. Note SaveChartToStream function is used by SaveChartToChart, and saving a chart to a file seems to save the ColorPalette correctly; running the following code produces a test.txt file where I can find the "ColorPaletteIndex = 0" property correctly serialized, so this is not the problem.
Code: Select all
uses Series, TeeStore, TeeURL;
procedure TForm1.Button1Click(Sender: TObject);
begin
Chart1.ColorPaletteIndex:=0;
Chart1.AddSeries(TPieSeries).FillSampleValues;
SaveChartToFile(Chart1, 'C:\tmp\test.txt', true, true);
end;
Code: Select all
procedure TForm1.Button2Click(Sender: TObject);
var ImportChart: TImportChart;
begin
ImportChart:=TImportChart.Create(Self);
ImportChart.Chart:=Chart1;
ImportChart.LoadFromFile('C:\tmp\test.txt');
end;
I strictly do:AST wrote:Open the chart editor, select Opera, save settings using SaveChartToStream
Reopen Chart editor>>OPERA is selected , select TeeChart, save using SaveChartToStrem
Reopen Chart Editor >> OPERA is selected
- Create a new project, D7 + TeeChart v2012.07.
- Add a TChart to the form.
- Backup and remove the "DefaultPalette" key in the registry at "HKEY_CURRENT_USER\Software\Steema Software\TeeChart Pro\Editor".
- Open the Themes tab in the chart editor. Check the palette selected is Opera.
- Place a button, make it use the following code and execute the application and the button:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
SaveChartToFile(Chart1, 'C:\tmp\test.txt', true, true);
end;
- Stop the application.
- Open the Themes tab in the chart editor. Change the palette from Opera to TeeChart.
- Execute the application and the button again. If I open the generated text.txt I see the line "ColorPaletteIndex = 0".
- Open the Themes tab in the chart editor. According to your instructions, you see the Opera palette is selected. However, I see the Default palette selected.
So this seems to work fine for me here. And I've also checked the registry and the "DefaultPalette" entry isn't present.
Do you see any relevant step I could miss?
- Attachments
-
- test.zip
- (880 Bytes) Downloaded 304 times
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |