Update FontWeight for existing legend items

Open
#56 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

Start at chart.Plot.Legend.ManualItems and compare the existing LabelFontName and LabelFontSize properties with the legend-item implementation used by ScottPlot Avalonia 5.1.59. Determine how an existing legend item's font weight can be exposed or updated, then verify that setting the weight changes rendered legend labels without affecting the other font settings.

Written by the indexing model from the issue text.

Description

Hi,

I'm using ScottPlot Avalonia 5.1.59.

I need to update the FontWeight for existing legend items. I can update the FontName and the FontSize, but I cannot find FontWeight.

Here is what I expect:

            foreach (var legendItem in chart.Plot.Legend.ManualItems)
            {
                legendItem.LabelFontName = FontManager.Current.DefaultFontFamily.Name;
                legendItem.LabelFontSize = (float)defaultSize;
                legendItem.LabelFontWeight = fontWeight;
            }

LabelFontWeight was not found. How can I update the FontWeight?

I would appreciate a reply
Alex

Dominant language
HTML
Stars
49
Forks
43
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ScottPlot/ScottPlot.NET

All issues in ScottPlot/ScottPlot.NET

Similar issues

More Desktop Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.