D3.js 如何在Serenity管理仪表板中添加新图表(任何图表、highcharts或d3图表)
我已经使用Serenity框架创建了一个应用程序。我已经使用serenity完成了CRUD的基本功能。基于我的表格,我需要有图形表示,任何图表,如高位图表、D3图表或任何其他图表。 1.如何使用serenity框架从表中获取数据?D3.js 如何在Serenity管理仪表板中添加新图表(任何图表、highcharts或d3图表),d3.js,charts,highcharts,D3.js,Charts,Highcharts,我已经使用Serenity框架创建了一个应用程序。我已经使用serenity完成了CRUD的基本功能。基于我的表格,我需要有图形表示,任何图表,如高位图表、D3图表或任何其他图表。 1.如何使用serenity框架从表中获取数据? 2.如何将数据自定义为图形表示?最后我找到了答案。我们可以使用sql查询和存储过程从数据库中获取数据。我使用存储过程从数据库中获取数据 在存储库页面中,您可以调用存储过程 public ListResponse<MyRow> GetCustomData(I
2.如何将数据自定义为图形表示?最后我找到了答案。我们可以使用sql查询和存储过程从数据库中获取数据。我使用存储过程从数据库中获取数据 在存储库页面中,您可以调用存储过程
public ListResponse<MyRow> GetCustomData(IDbConnection connection)
{
var data = connection.Query<MyRow>("GetOrders",
param: new
{
startDate = request.nstartDate,
endDate = request.EndDate
},
commandType: System.Data.CommandType.StoredProcedure);
var response = new ListResponse<MyRow>();
response.Entities = (List<MyRow>)data;
return response;
公共列表响应GetCustomData(IDbConnection连接)
{
var data=connection.Query(“GetOrders”,
param:新的
{
startDate=request.nstartDate,
endDate=request.endDate
},
commandType:System.Data.commandType.StoredProcess);
var response=新的ListResponse();
实体=(列表)数据;
返回响应;
}
我已经像这样将MyRow定义为OrderRow
使用MyRow=Entities.OrderRow
您可以从控制器调用此方法。您可以将值传递给模型,并可以将数据用于图表,如highcharts或d3图表
希望这对你有帮助