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

  • SEARCH
  • Home
  • 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 8179337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:58:44+00:00 2026-06-06T23:58:44+00:00

I am following the example at this tutorial: But unfortunately their documentation is so

  • 0

I am following the example at this tutorial:
But unfortunately their documentation is so vague I can’t get anything working properly.

http://www.visiblox.com/blog/posts/2011/06/13/data-binding-with-visiblox-charts/#asg

What I am trying to do is use AutoSeriesGenerator to create a new series automatically for me and also add that lineseries to a primary Y Axis. I am hoping some of you have a good experience with Visiblox. Here is how I thought their example should be represented in C#:

 <local:WeatherStationsData x:Key="dataCollection">
            <local:WeatherStationTemperature>
                <local:HourTemperature Hour="1" Temperature="10" />
                <local:HourTemperature Hour="2" Temperature="14" />
            </local:WeatherStationTemperature>
            <local:WeatherStationTemperature>
                <local:HourTemperature Hour="1" Temperature="20" />
                <local:HourTemperature Hour="2" Temperature="19" />
            </local:WeatherStationTemperature>
        </local:WeatherStationsData>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
      <charts:Chart x:Name="Chart"
                    charts:AutoSeriesGenerator.XValuePath="Hour"
                    charts:AutoSeriesGenerator.YValuePath="Temperature"
                    charts:AutoSeriesGenerator.ChartSeriesProvider="LineSeries"
                    charts:AutoSeriesGenerator.ItemsSource="{StaticResource dataCollection}">
                    <charts:Chart.XAxis>
                <charts:LinearAxis />
            </charts:Chart.XAxis>
            <charts:Chart.YAxis>
                <charts:LinearAxis />
            </charts:Chart.YAxis>
        </charts:Chart>



  //X and Y points
   public class ChartDataPoint
    {
        public DateTime X { get; set; }
        public float Y { get; set; }
        public ChartDataPoint(DateTime X, float Y)
        {
            this.X = X;
            this.Y = Y;
        }
    }



  //represents a dataseries - collection of datapoints
   public class DataPointsCollection : ObservableCollection<ChartDataPoint>
    {
    }
 //the "dataseries"
 public class DataSeries : ObservableCollection<DataPointsCollection>
    {
    }

But it isn't working as expected.



       public IChartSeries CreateSeries(object targetParent, object boundObject)
            {
                LineSeries lineSeries = null;

                if (targetParent is LineSeries)
                {
                    lineSeries = new LineSeries();
                    lineSeries.YAxis = new LinearAxis();
                    AxisCollection.Add(lineSeries.YAxis);
                }
                return lineSeries;
            }

Their documentation says targetObject is business object that the IChartSeries is wrapped around. But what I am getting instead of the object is a collection! And that method is always called multiple times, which means it generates a lot of Lineseries.
I have tried the CollectionChanged event and it is the same problem. It doesn’t get called once but gets called multiple times which doesn’t make sense to me.

How can I solve this problem, thanks.

  • 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-06T23:58:46+00:00Added an answer on June 6, 2026 at 11:58 pm

    This is quite embarrassing as I was struggling with this all day. Hate it when I post a question then manage to solve it minutes after :O.

    I decided to try this and it worked – very slow! 🙁

    In your code behind:

    private void Series_CollectionChanged(object sender,
             NotifyCollectionChangedEventArgs e)
    {
            if(e.Action == NotifyCollectionChangedAction.Add)
            {
                var lineSeries = (LineSeries) MultiChart.Series[e.NewStartingIndex];
                if (!collection.Contains(lineSeries.YAxis))
                {
    
                    lineSeries.YAxis = new LinearAxis();
                    collection.Add(lineSeries.YAxis);   
                }
            }
            else if(e.Action == NotifyCollectionChangedAction.Reset )
            {
                collection.Clear();
            }
    }
    

    In your CustomLineSeries or whatever:

     public IChartSeries CreateSeries(object targetParent, object boundObject)
     {
       if (boundObject is DataPointsCollection)
       {
           LineSeries lineSeries = new LineSeries();
           return lineSeries;
       }
      return null;
    }
    

    I should have made sure that the boundobject is a business object and ta da!

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

Sidebar

Related Questions

I am following the first example in this tutorial: http://ruportbook.com/printable_documents.html , but I'm getting
I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog
I tried following the gradle manual with their example like this but copyJars is
I'm following this example tutorial project code: http://akrabat.com/wp-content/uploads/zf-tutorial-layoutform.zip tutorial: http://akrabat.com/zend-framework/a-form-in-your-layout/ The project code runs
http://developer.android.com/training/basics/firstapp/building-ui.html I have been following this tutorial, but I have two errors, both R
I'm following this example: http://www.codinghorror.com/blog/2005/12/getting-started-with-indexing-service.html However, the conversion to dataset shows empty columns for
I am following this example to get JSONP data from remote server. jQuery append
Check this example before reading the question - http://www.sqlfiddle.com/#!2/fcf3e/8 The following data comes from
I've been following this tutorial on how to create an OData service. http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx And
I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top , and I tried this in the

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.