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 8315083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:02:36+00:00 2026-06-08T21:02:36+00:00

I am using Dotnet Highchart that is based on C# code that has output

  • 0

I am using Dotnet Highchart that is based on C# code that has output code javascript.
Dotnet HighChart

This is almost how my chart looks like:

Charts

I am using data from my database to give this chart data by using LINQ queries.

I have a column “Completed Date” in my entity and I need to make two textboxes with datepicker so user can choose Start and end dates of Completed Date.Then the user should be able to click on a submit button and then the chart should update and show the statistic between the two dates. I have the complete LINQ Query for this

This is the LINQ query that I am going to use:

public List<CoreValueAndAverageGrade> GetAverageGradeForAllCoreValues(DateTime startDate, DateTime endDate)
        {



            return db.CoreValue
                .Where(coreValue => coreValue.CoreValueQuestion
                    .Any(coreValueQuestion => coreValueQuestion.SubjectType.Ignored_Statistic == false))
                .Select(coreValue => new CoreValueAndAverageGrade
                {
                    CoreValue = coreValue,
                    AverageGrade = coreValue.CoreValueQuestion
                        .Where(coreValueQuestion => coreValueQuestion.SubjectType.Ignored_Statistic == false)
                        .Average(coreValueQuestion => coreValueQuestion.SelectedQuestions
                            .Where(selectedQuestion => selectedQuestion.GoalCardQuestionAnswer != null
                                && selectedQuestion.GoalCardQuestionAnswer.Grade.HasValue

                            && selectedQuestion.GoalCard.Completed_Date >= startDate
                            && selectedQuestion.GoalCard.Completed_Date <= endDate
                                )
                            .Average(selectedQuestion => selectedQuestion.GoalCardQuestionAnswer.Grade.Value))
                })
                .ToList();
        }

This is my ViewModel

 public class OfficeStatisticNKIViewModel
    {
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
    }

In my GET action method I have following code:

public ActionResult OfficeStatistic()
{
    {
       OfficeStatisticNKIViewModel model = new OfficeStatisticNKIViewModel();
       model.EndDate = DateTime.Now;
       model.StartDate = DateTime.Now;
        var averageGrades = OfficeStatisticRepository.GetAverageGradeForAllCoreValues(model.StartDate, model.EndDate);

        var dataItems = (averageGrades.Select(averageGrade => averageGrade.AverageGrade).ToArray());
        Data data = new Data(
            dataItems.Select(y => new Point {Color = GetBarColour(y), Y = y}).ToArray());


        Highcharts chart1 = new Highcharts("Chart")
         .SetXAxis(new XAxis { Categories = averageGrades.Select(averageGrade => averageGrade.CoreValue.Name).ToArray() })
         .SetYAxis(new YAxis { Min = 0, Max = 10, TickInterval = 1, Title = new YAxisTitle { Text = "Betygskalan" } })
         .SetSeries(new Series {  Data = data, Name = "Snittbetyg" })
         .SetLegend(new Legend { Enabled = false })
         .SetTitle(new Title { Text = "Örebro Statistik", })
         .InitChart(new Chart { DefaultSeriesType = ChartTypes.Column });


        return View(new Container(new[] { chart1 }));

    }

The problem is that I have no idea how to do the post action method, The chart needs to update with the new the statistic, do I need some kind of ajax or can I do this on the serverside?

Any kind of help or tips is very appreciated!

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-08T21:02:38+00:00Added an answer on June 8, 2026 at 9:02 pm

    http://dotnethighcharts.codeplex.com/discussions/350721/

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

Sidebar

Related Questions

Using dotnet 2.0. I currently have code like this : DataView dv = new
Using dotnet 2.0. Can the following code be improved in style ? private object
This question is related to another question I wrote: Trouble using DOTNET from PHP.
I am using the following regular expression (from http://www.simple-talk.com/dotnet/asp.net/regular-expression-based-token-replacement-in-asp.net/ ) (?<functionName>[^\$]*?)\((?:(?<params>.**?)(?:,|(?=\))))*?) it works fine,
I am doing web based projects in dotnet. Currently I am implementing security using
using dotnet 2.0. Code to illustrate : Class1 c1 = new Class1(); c1.SomeInt =
I'm using GCheckout.dll (Google Checkout v2.5.0.6 dll - http://code.google.com/p/google-checkout-dotnet-sample-code/downloads/list ) to implement google checkout
my dotnet code base is pretty big (so I don't feel like undertaking refactor
i have a COM object that i am using in dotnet and i have
We have a dotnet web service that a java using customer wants to connect

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.