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

Setting line colors from object data #94

Open
Hedkeaf opened this issue Nov 24, 2022 · 9 comments
Open

Setting line colors from object data #94

Hedkeaf opened this issue Nov 24, 2022 · 9 comments

Comments

@Hedkeaf
Copy link

Hedkeaf commented Nov 24, 2022

One of base usage its setting color lines by series(from data), but i cant do it in current chart. Maybe someone know way how to do it?

@Hedkeaf
Copy link
Author

Hedkeaf commented Nov 24, 2022

I can do it in Scutter by ColorField but Scutter dont allow multiple series

@dkosinskyi
Copy link

show you config and data

@dkosinskyi
Copy link

dkosinskyi commented Nov 24, 2022

Try this

ColorField: "Genre",
     Color = new string[] {"#d62728", "#2ca02c", "#000000", "#9467bd", "#ffd500", "#1f77b4", "#00518a", "#ffbc69", "#9bd646"},

@Hedkeaf
Copy link
Author

Hedkeaf commented Nov 24, 2022

show you config and data

protected LineConfig ChartConfig = new LineConfig
{
Title = new AntDesign.Charts.Title
{
Visible = true,
Text = "Cloud Orders"
}
Point = new LineViewConfigPoint
{
Visible = true,
Size = 3,
Color = "Grey"
},
Tooltip = new AntDesign.Charts.Tooltip()
{
Shared = false
},
ForceFit = true,
Padding = "auto",
XField = "timelabel",
YField = "price",
Color = "transparent",
YAxis = new ValueAxis()
{
Grid = new BaseAxisGrid()
{
Visible = true
},
Visible = true
},
Legend = new Legend
{
Position = "bottom"
},
SeriesField = "key"
};

@dkosinskyi
Copy link

dkosinskyi commented Nov 24, 2022

Try this

     Color = new string[] {"#d62728", "#2ca02c", "#000000", "#9467bd", "#ffd500", "#1f77b4", "#00518a", "#ffbc69", "#9bd646"},

@Hedkeaf
Copy link
Author

Hedkeaf commented Nov 24, 2022

Try this

ColorField: "Genre",
     Color = new string[] {"#d62728", "#2ca02c", "#000000", "#9467bd", "#ffd500", "#1f77b4", "#00518a", "#ffbc69", "#9bd646"},

ColorField Does not exist in LineConfig.
Im try using Scutter but scutter not contains SeriesField for multiply series

@Hedkeaf
Copy link
Author

Hedkeaf commented Nov 24, 2022

image

@dkosinskyi
Copy link

Show how lines are drawn on a chart

@Hedkeaf
Copy link
Author

Hedkeaf commented Nov 24, 2022

When color is "transparent" draw only points, but when im switch to show lines they have random colors
protected async Task SetLines() { if (ShowLines) { ChartConfig.Color = new string[] { "Red", "Green" }; } else ChartConfig.Color = "transparent"; await Chart.UpdateConfig(ChartConfig); }
Graf seems like this:
image

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