O'Doyle

New member
Joined
Apr 13, 2022
Messages
1
Programming Experience
Beginner
I have a table with weather data. The table consists of an ID, the temperature and the date. I would like to have the temperature data to and the respective year in a line chart output. I want to be able to select via a dropdown menu or via a textbox the respective ID, so that for the temperature and the year for the respective ID is displayed in the line chart. how do I do that? I want to write the whole thing in an extra LiveChart class and not in the MainWindow class. The project, context and migration have already been created. This is the Line Chart I want to use: Live Charts

C#:
public class temperature
{
    private WeatherContext context;

    public temperature(WeatherContext cont)
    {
        context = cont;
    }

    public List<temperature> GetAll()
    {
        return context.temperature.ToList();
    }

    public List<temperature> GetByID (int id)
    {
        var tem = context.temperature.Where(t => t.ID == id).ToList<temperature>();
        return tem;
    }

C#:
public class ConnectionClass
{
    private WeatherContext Context;
    internal temperature tmp;
    public ConnectionClass()
    {
        context = new WeatherContext();
        tmp = new temperature(Context);

    }

C#:
public partial class MainWindow : Window
{
    private ConnectionClass cc = new ConnectionClass();
    private WeatherContext context;
    public MainWindow()
    {
        InitializeComponent();
    }

C#:
public class LineChart
{

}
 
Back
Top Bottom