Добавить высокие графики в ASP. NET MVC с базой данных - PullRequest
0 голосов
/ 10 апреля 2020

Я очень новичок в ASP. NET, и я хотел бы отображать старшую диаграмму под моей таблицей всякий раз, когда я нажимаю на строку.

Итак, допустим, у меня есть таблица с столбцами

Id, Name, Date,blood pressure

И я хочу добавить нижнюю диаграмму под ним, когда я нажимаю, например, на имя, которое будет отображать кровяное давление на старшей диаграмме.

Пока это мой код:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using trial.Models;

namespace RetrieveValue.Controllers
{
    public class HomeController : Controller
    {
        RetrieveDemoEntities retrieve = new RetrieveDemoEntities();

        public ActionResult Index()
        {
            return View(retrieve);
        }
    }
}

Это для извлечения данных из базы данных.

Страница индекса:

@model trial.Models.RetrieveDemoEntities
@{
    ViewBag.Title = "Index";
}

<h2>Retrieving Data From Database</h2>

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>

    <style type="text/css">
        table, td, th {
            border: 1px solid green;
        }

        th {
            background-color: Pink;
            color: white;
        }
    </style>
</head>
<body>
    <table style="margin-left: 25%; margin-top: 10px; border: 2px solid LightGray;">
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Date_of_birth</th>
            <th>Blood Pressure</th>
        </tr>

        @foreach (var item in Model.patient_infoes)
        {
            <tr>
                <td>@item.ID</td>
                <td>@item.Name</td>
                <td>@item.Date_of_Birth</td>
                <td>@Blood_pressure</td>
            </tr>
        }
    </table>
</body>
</html>

Спасибо вам, ребята, за ваше время

...