Jump to content

UniChart columns color


Denny Sbanchi

Recommended Posts

Hi everyone,

yesterday I started working with the TUniChart component, I've only a little problem: How can I create a Chart with only one BarSerie with columns of different colors? 

At this moment I only undestanded how to insert different Series and color them, but it doesn't fit for my case.

 

Thanks for answers and best regards.

Link to comment
Share on other sites

Hi Sherzod!

I'm doing the procedure required, but I've a problem: I don't know which is the password in the FMSoft login form, my chief has his own password, which one do I have to use?

I've already tried the password of the forum but it doesn't work...

 

-----

Problem solved, I've found the password and completed the procedure.

Link to comment
Share on other sites

49 minutes ago, Denny Sbanchi said:

yes something like that

Can you try to use this approach?

procedure TMainForm.UniFormReady(Sender: TObject); // OnReady event
begin
  with UniChart1 do // your UniChart
  begin
    JSInterface.JSConfig('colors', [JSInterface.JSStatement('["red", "yellow", "blue", "#ff7788"]')]); //or more colors
    JSInterface.JSCall('chart.series[0].setRenderer', [JSInterface.JSFunction('sprite, record, attributes, index, store',
      '    if (record) {'+
      '        if ('+ JSName +'.colors[index]) {'+
      '            attributes.fill = '+ JSName +'.colors[index];'+
      '        }'+
      '    }'+
      '    return attributes;'
    )]);
  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...