Jump to content

UniChart:How to make a chart like this?


55143681

Recommended Posts

20 hours ago, Sherzod said:

I'm not sure if this is possible.

i try'd like this:

img1.jpg

with your code, that i found here :

procedure TMainForm.UniButton2Click(Sender: TObject);
var st:string;
begin

  st:='''Red'',''Yellow'',''Green''';

  with UniChart3.JSInterface do
  begin
    JSAssign('chart.colors', [JSArray(['green','yellow','red'])]);
    JSCall('chart.refresh', []);
  end;

end;

will not work.

but if this work, thats enough for me, i will try to repaint the chart with the correct colors then retroactively.

 

 

Link to comment
Share on other sites

2 hours ago, alice123 said:

with UniChart3.JSInterface do
  begin
    JSAssign('chart.colors', [JSArray(['green','yellow','red'])]);
    JSCall('chart.refresh', []);
  end;

with UniChart3.JSInterface do
  JSCall('chart.setColors', [JSArray(['green','yellow','red'])]);

 

Link to comment
Share on other sites

4 minutes ago, Sherzod said:

yes, there was my code from

>>Now, is it possible to change colors at runtime ?

and this was your code from there:

with UniChart3.JSInterface do
  begin
    JSAssign('chart.colors', [JSArray(['green','yellow','red'])]);
    JSCall('chart.refresh', []);
  end;

but this give me this error:

img1.jpg

 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

 

I mean, seven years ago you have been registered on the forum. And you are still using the trial version.

Yes, got forgotten for a long time, now i will get more and more Interesting.

But, if it isnt possible (chart bar color) then ok, we (i) have to look for a other solution (with unigui).

  • Upvote 1
Link to comment
Share on other sites

6 hours ago, alice123 said:

No, because it need to be possible change colors at runtime .

This code is for this purpose. Have you tested?

3.

procedure TMainForm.Set_Colors(L:Tstrings);
begin
  with UniChart1.JSInterface do
  begin
    L.Delimiter:=',';
    JSCode(#1'.chart.colors="' + L.DelimitedText + '".split(",");');
    JSCode(#1'.chart.series[0].setRenderer();');
    JSCode(#1'.chart.series[0].setRenderer('#1'.chart.refill);');
  end;

end;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...