Jump to content

Cannot assign new Title to streams of a UniChart


Woutero

Recommended Posts

@Woutero

21 minutes ago, Sherzod said:

Then just set a large number, for example 1000 instead of 50.

For example:

UniChart.ClientEvent.UniEvents -> 

image.png.52adf9c3162bf7fae69a727b70cb6163.png

function chart.beforeInit(sender, config)
{
    config.series[0].renderer = function(a) {
          a.attr.maxBarWidth = 1000;
          a.attr.minGapWidth = 20;
          a.attr.inGroupGapWidth = 5;
          return a
    };
}

 

Link to comment
Share on other sites

11 hours ago, Sherzod said:

Okay.

Then just set a large number, for example 1000 instead of 50.

Sherzod

Youre right, simply setting a large number for MaxBarWidth as the default value is the easiest solution!

Thanks

image.png.9e0dda85c45da45a63d95e0fd53899ed.png

Link to comment
Share on other sites

Sherzod
In another thread you gave the following solution for hiding the legend that appears inside very pie:

UniChart ("PieChart")-> ClientEvents -> UniEvents -> function chart.beforeInit:

function chart.beforeInit(sender, config)
{
    config.series[0].renderer=function(sprite, config, rendererData, index){
        return {label: ""}
    }
}


But when I do this, I get an error:
Cannot read properties of undefined (reading '0')

 

Is there a way that I can do this via a JSCall()?

 

This is what I need, just the pie chart without the lines and label on the  border

image.png.ed99cda6e10691cca4f046a26c341ad3.png

Link to comment
Share on other sites

4 hours ago, Woutero said:

Is there a way that I can do this via a JSCall() so that I can switch between hide/display during runtime?

One possible solution:

1. 

function chart.beforeInit(sender, config)
{
    config.series[0].renderer=function(sprite, config, rendererData, index){
        return {label: ""}
    }
}

2. image.png.d69d13bf3e1d4e3be42c7f8122f08050.png

3. UniChart.ClientEvents.ExtEvents ->

function afterrender(sender, eOpts)
{
    sender.chart.series[0].setLabel({display: 'none'});
}

4. Runtime ->

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniChart1.JSInterface.JSCall('chart.series[0].setLabel', [UniChart1.JSInterface.JSStatement('{display: "outside"}')]); //none
end;

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 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...