Abaksoft Posted December 12, 2017 Share Posted December 12, 2017 Yes, that worked fine (for an other purpose). But now : 1 color for all Bars (on 1 UniBarSerie). Below graphic. On the program I sent you : I have an UniChart with one UniBarSeries. I can Set the color on MainForm. OnCreat Event (let say yellow for all bars) but at Runtime, when I Click on UniButton1 to change all Bars color to red, not work. Thx _____ Edit : The UniBarSeries : Sometimes contains 3 bars, Sometimes contains 25, Sometimes contains 50.... (it depend on a dataSource) so Method topic#15 is not appropriate. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 12, 2017 Share Posted December 12, 2017 Ok I will check this and let you know Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 12, 2017 Share Posted December 12, 2017 Hi, Can you try this approach?: 1. procedure TMainForm.UniFormCreate(Sender: TObject); var myColor: string; begin myColor := 'red'; UniChart1.ClientEvents.UniEvents.Values['chart.beforeInit']:= 'function(sender, config)'+ '{' + 'sender.themeAttrs.seriesThemes = [{fill: "' + myColor + '"}];' + 'sender.themeAttrs.colors=["' + myColor + '"];' + //'sender.themeAttrs.refresh;' + '}' ; //Set_Color('red'); Construct_MyGraph; end; 2. procedure TMainForm.Set_Color(MyColor:string); begin with UniChart1.JSInterface do begin JSCode(#1'.chart.themeAttrs.colors[0]="' + MyColor + '";'); JSCode(#1'.chart.themeAttrs.seriesThemes[0].fill="' + MyColor + '";'); JSCall('chart.redraw', []); end; end; 3. procedure TMainForm.UniButton1Click(Sender: TObject); begin Set_Color('green'); end; Best regards, 1 Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted December 13, 2017 Share Posted December 13, 2017 Yes !!! Thank you very Much DD Quote Link to comment Share on other sites More sharing options...
OwlHatSoftware Posted July 10, 2018 Share Posted July 10, 2018 Hello, In runtime I like to set the colors of a stacked bar chart. So, every stack its own color. How can I do that? Using UniGui version 1470. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 10, 2018 Share Posted July 10, 2018 Hello, Which edition are you using? Quote Link to comment Share on other sites More sharing options...
OwlHatSoftware Posted July 11, 2018 Share Posted July 11, 2018 I'am using UniGui 1.10.0.1470 with Delphi Tokyo 10.2. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 11, 2018 Share Posted July 11, 2018 First of all, please adjust your forum email address: http://forums.unigui.com/index.php?/topic/6291-new-users-please-adjust-your-forum-email-address/ Quote Link to comment Share on other sites More sharing options...
neo4a Posted January 21, 2019 Share Posted January 21, 2019 On 12/12/2017 at 8:03 PM, Sherzod said: 1. procedure TMainForm.UniFormCreate(Sender: TObject); var myColor: string; begin myColor := 'red'; UniChart1.ClientEvents.UniEvents.Values['chart.beforeInit']:= 'function(sender, config)'+ '{' + 'sender.themeAttrs.seriesThemes = [{fill: "' + myColor + '"}];' + 'sender.themeAttrs.colors=["' + myColor + '"];' + //'sender.themeAttrs.refresh;' + '}' ; //Set_Color('red'); Construct_MyGraph; end; Used this code in one of my older projects successfully. With current/newer version of ExtJSVersion 6.6.0 this approach is not working anymore. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 21, 2019 Share Posted January 21, 2019 19 minutes ago, neo4a said: Used this code in one of my older projects successfully. With current/newer version of ExtJSVersion 6.6.0 this approach is not working anymore. Hi, Are you using a BarSeries ? Quote Link to comment Share on other sites More sharing options...
neo4a Posted January 21, 2019 Share Posted January 21, 2019 Yes I do. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 21, 2019 Share Posted January 21, 2019 Ok we will check Quote Link to comment Share on other sites More sharing options...
neo4a Posted January 23, 2019 Share Posted January 23, 2019 I'll be glad if we can find a solution soon. TIA. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 23, 2019 Share Posted January 23, 2019 30 minutes ago, neo4a said: I'll be glad if we can find a solution soon. TIA. Hello, Try this config UniChart -> ClientEvents -> UniEvents -> function chart.beforeInit: function chart.beforeInit(sender, config) { config.colors = ["green", "yellow", "red", "#94ae0a", "#115fa6", "#a61120", "#ff8809", "#ffd13e", "#a61187", "#24ad9a", "#7c7474", "#a66111"]; } Quote Link to comment Share on other sites More sharing options...
neo4a Posted January 23, 2019 Share Posted January 23, 2019 Thanks. It just work. Quote Link to comment Share on other sites More sharing options...
AntonioM Posted August 8, 2020 Share Posted August 8, 2020 This is not working in Unigui 1.90.0.1496. How can we edit the default colors? Are they in a file? Thx Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 8, 2020 Share Posted August 8, 2020 4 hours ago, AntonioM said: This is not working in Unigui 1.90.0.1496. How can we edit the default colors? Are they in a file? What "Series" are you using? Quote Link to comment Share on other sites More sharing options...
AntonioM Posted August 18, 2020 Share Posted August 18, 2020 I have two bar series created in design. Not stacked. If I assign different brush colors C1 and C2 to them, when running, all bars in both series appear with color C1. It does not work assigning colors in design time nor in run time. And in the legend still appear original colors. Thx in advance Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 18, 2020 Share Posted August 18, 2020 9 minutes ago, AntonioM said: I have two bar series created in design. Not stacked. If I assign different brush colors C1 and C2 to them, when running, all bars in both series appear with color C1. It does not work assigning colors in design time nor in run time. And in the legend still appear original colors. Hi, Can you make a simple testcase? Quote Link to comment Share on other sites More sharing options...
AntonioM Posted August 18, 2020 Share Posted August 18, 2020 I attach a sample. In this one I also show some UniCalendarPanel doubts. Thx. _pruebas.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 19, 2020 Share Posted August 19, 2020 16 hours ago, AntonioM said: I attach a sample. I will check. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.