Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I change Bars color? #10

Closed
maxxhount opened this issue Dec 9, 2020 · 1 comment
Closed

How can I change Bars color? #10

maxxhount opened this issue Dec 9, 2020 · 1 comment

Comments

@maxxhount
Copy link

I would like to change Bars colors. This is my code
`

<ApexSeries TItem="OperationBarChartData" 
    Items="Data" Name="Encaissement" 
    XValue="@(o => o.Month)"
    YAggregate="@(o => o.Sum(o => o.IncomeAmount))" 
    OrderByDescending="e=>e.Y" />

<ApexSeries TItem="OperationBarChartData" 
    Items="Data" Name="Décaissement" 
    XValue="@(o => o.Month)"
    YAggregate="@(o => o.Sum(o => o.ExpenseAmount))" 
    OrderByDescending="e=>e.Y" />

@code {
[Parameter]
public List Data { get; set; }

private ApexChartOptions<OperationBarChartData> GetOptions()
{
    var options = new ApexChartOptions<OperationBarChartData>();
    **options.Colors = new List<string>{"#3699FF","#2670FF"};**
    return options;
}

}`

When i remove the Options, my bars display with the default colors (blue and green).
image

But when I add Options nothing display.
image

How can I change the bar colors?

@joadan
Copy link
Member

joadan commented Dec 9, 2020

Hi,

Check this example StatisticsLineChart.razor in the TabBlazor repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants