Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:38:32+00:00 2026-06-03T14:38:32+00:00

I am new for WPF application.I am working on a Sensor reading WPF application.In

  • 0

I am new for WPF application.I am working on a Sensor reading WPF application.In this application i have to select sensors out of 170 Sensors.After selecting sensors when i click on view report then chart plotter draw the Graph of selected sensors.It Works fine for me.

Problem :

Here due to page size limitation i have fixed height of graph.But when count of sensors is more than the height of graph then legends of selected sensors hide those who are not adjust in the height of graph.How i can add scroll to legend box so that user can scroll and check all sensor legends.

Please give some idea.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:38:34+00:00Added an answer on June 3, 2026 at 2:38 pm

    I searched a lot on web for this problem but i got no solution for this.So to solve this problem i follow these steps.

    1.)first i make plotter legend visibility false by
    plotter.LegendVisible = false;

    2.)Second i add a listview control exactly on the graph where plotter Legend was appear.

      <ListView Height="Auto" HorizontalAlignment="Center" Margin="1100,139,0,0" Name="listview" ItemsSource="{Binding Items}" HorizontalContentAlignment="Stretch" VerticalAlignment="Top" Width="75" Grid.RowSpan="2" MaxHeight="260">
                                <ListView.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Text}" Foreground="{Binding BackgroundColor}">
                                        </TextBlock>
                                    </DataTemplate>
                                </ListView.ItemTemplate>
                                <ListView.BorderBrush>
                                    <SolidColorBrush />
                                </ListView.BorderBrush>
                            </ListView>
    

    3.)Then i do some work on back end as –

    -Add ItemVM.cs :

     class ItemVM : INotifyPropertyChanged
    {
        private string TextValue = String.Empty;
        private Brush BackgroundColorValue = null;
    
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    
        public ItemVM(Brush color, string objectData)
        {
            BackgroundColor = color;
            Text = objectData;
        }
        public string Text
        {
            get
            {
                return this.TextValue;
            }
    
            set
            {
                if (value != this.TextValue)
                {
                    this.TextValue = value;
                    NotifyPropertyChanged("Text");
                }
            }
        }
        public Brush BackgroundColor
        {
            get
            {
                return this.BackgroundColorValue;
            }
    
            set
            {
                if (value != this.BackgroundColorValue)
                {
                    this.BackgroundColorValue = value;
                    NotifyPropertyChanged("BackgroundColor");
                }
            }
        }
    
    }
    

    -In mainform.xaml.cs :

     List<ItemVM> Items;
                   List<string> lst = new List<string> {"item1","item2","item3" };
                   var converter = new System.Windows.Media.BrushConverter();
      Color[] colors = ColorHelper.CreateRandomColors(3);
      Items = new List<ItemVM>();
     for(int i=0;i<lst.count;i++)
     {
     Items.Add(new ItemVM((Brush)converter.ConvertFromString(colors[i].ToString()), SelectedItems[i]));
    }
     plotter.LegendVisible = false;
     listview.ItemsSource = Items;
    

    Now i got legend box on chart plotter with scroll and regend forecolor also reflect chart line color.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to wpf and i am working on first application i have
I am new to WPF and MVVM, and I am working on an application
I have window form in my WPF Application when I open new window from
I have just changed my WPF application from .Net3.5 to .Net4. Doing this caused
I am currently working on a WPF application where I would like to have
I'm working on an WPF application using the mvvm-light framework. I'm new to both
I'm working on a new WPF application and I'm trying to stay as close
I have a WPF application using MVVM that utilises TreeViewItemViewModels to simplify working with
I am working on a wpf application. I am having one image, i have
I am working on WPF application.I have bound my textblock to my button. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.