Jump to content


Photo

uniChart Set Color On BarSeries

Chart Color

  • Please log in to reply
28 replies to this topic

#21 RobYost

RobYost

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 195 posts
  • LocationFlorida, USA

Posted 07 December 2017 - 10:06 PM

I was reading this thread and noticed Abaksoft has Sencha 6.5.2

 

When I look in my ServerModule I see ExtJsVer=ext-4.2.5.1763

 

Is that my Sencha version? 

 

Have I missed some sort of upgrade?  I have 1.0.0.1420


  • 0

http://unigui.mirahe.../wiki/Main_Page

Please add any utilities you think are useful. I will try to keep the wiki organized.


#22 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3643 posts

Posted 08 December 2017 - 03:21 AM

http://forums.unigui...eta/#entry49940
  • 0

#23 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 490 posts
  • LocationAlgeria

Posted 11 December 2017 - 08:51 AM

Hello DD,

 

Sorry for this simple question :

1.  I can'nt refresh UniBarSeries  color  in  RunTime  !

Attachment a TestCase (Build 1421)  

 

2. Also, to not disturb you too much, where can we find Sencha examples ?

 

Thx

Attached Files


  • 0

#24 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 490 posts
  • LocationAlgeria

Posted 12 December 2017 - 06:34 AM

Hello DD,
Can you see, please my code in topic #23 (refresh 1 UniBarSeries = 1 Color)
Thx again.
  • 0

#25 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3643 posts

Posted 12 December 2017 - 06:38 AM

Hi,

Sorry for the late reply.

http://forums.unigui...ies/#entry49410doesn't work?
  • 0

#26 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 490 posts
  • LocationAlgeria

Posted 12 December 2017 - 08:56 AM

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.

Attached Files


  • 0

#27 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3643 posts

Posted 12 December 2017 - 09:19 AM

Ok I will check this and let you know
  • 0

#28 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3643 posts

Posted 12 December 2017 - 07:03 PM

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

#29 Abaksoft

Abaksoft

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 490 posts
  • LocationAlgeria

Posted Yesterday, 07:51 AM

Yes !!!

Thank you very Much DD 

:)


  • 0





Also tagged with one or more of these keywords: Chart, Color

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users