Jump to content

change Color of UniGauge ValueStyle at runtime


mofareh

Recommended Posts

how i can change the UniGauge ValueStyle Brush Color at runtime

this code not working!!

 

if UniTrackBar1.Position>50 then
    begin
      UniGauge3.ValueStyle.Brush.Color:=clred;
    end
    else
    begin
      UniGauge3.ValueStyle.Brush.Color:=clgreen;
    end;
  UniGauge3.Value := UniTrackBar1.Position;

 

image.png.755ccd1fe861e7a2c2a8fbf7a73943fd.png

Link to comment
Share on other sites

16 hours ago, mofareh said:

how i can change the UniGauge ValueStyle Brush Color at runtime

Hello,

Some workaround:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  with UniGauge1 do
  begin
    ValueStyle.Brush.Color := clGreen;

    JSInterface.JSAssign('getRefItems()[0].valueArc.style.fill', [uniColor2Web(ValueStyle.Brush.Color)]);
  end;
end;

 

Link to comment
Share on other sites

  • 2 weeks later...

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...