Jump to content

Change color of line in UniChart


artem_niko

Recommended Posts

1 minute ago, Sherzod said:

Пока не знаю. Но я думаю, что это возможно, я думаю, нужно сосредоточиться на темах диаграммы.

I've reviewed every property. The available properties do not change the color in any way.

Link to comment
Share on other sites

1 hour ago, artem_niko said:

Yes, like this

Okay.

Try this approach:

function chart.beforeInit(sender, config)
{
    //axisY
    config.axes[0].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='red';
        return v
    };
    
    //axisX
    config.axes[1].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='green';
        return v
    };  
}

image.png.a42033e2ca230d6f64a2d8ba53633d50.png

  • Like 1
Link to comment
Share on other sites

21 hours ago, Sherzod said:

Okay.

Try this approach:

function chart.beforeInit(sender, config)
{
    //axisY
    config.axes[0].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='red';
        return v
    };
    
    //axisX
    config.axes[1].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='green';
        return v
    };  
}

image.png.a42033e2ca230d6f64a2d8ba53633d50.png

Thank you, @Sherzod!

But, see:

image.png.bf48d7b1bbc59a74234410a20e2b6186.png

As you can see, it adds a signature on the left and numbers on the bottom, and I don't need to display them...

Link to comment
Share on other sites

Try this approach:

function chart.beforeInit(sender, config)
{
    //axisY
    config.axes[0].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='red';
        return ''
    };
    
    //axisX
    config.axes[1].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='green';
        return ''
    }; 
}

 

  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Sherzod said:

Try this approach:

function chart.beforeInit(sender, config)
{
    //axisY
    config.axes[0].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='red';
        return ''
    };
    
    //axisX
    config.axes[1].renderer = function(s, v, a) {
        a.attr.canvasAttributes.strokeStyle='green';
        return ''
    }; 
}

 

And this working is perfect!

Thank you, @Sherzod! :)

  • Thanks 1
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...