简体   繁体   English

具有实体框架的C#上的Fusioncharts

[英]Fusioncharts on C# with entity framework

I know fusioncharts only use XML/JSON as entries, but, is there a way i can use my entity model with fusioncharts? 我知道Fusioncharts仅使用XML / JSON作为条目,但是,有没有一种方法可以将我的实体模型与FusionCharts一起使用? , or should i need to create the xml from my database and send it to fusioncharts?. ,还是我需要从数据库中创建xml并将其发送到Fusioncharts?

for example, i could try something like this... 例如,我可以尝试这样的事情...

StringBuilder xmlData = new StringBuilder();
xmlData.Append ("<set label='.Entity.Name.' value='.Entity.Value.' />");

On a Foreach, to build the xml for fusioncharts, but, i want to know if there's an easy way to do this, is there a way that the entity framework gives me the XML or Fusioncharts could read an Object or List? 在Foreach上,要为Fusioncharts构建xml,但是,我想知道是否有一种简单的方法可以执行此操作, 是否有一种方法使实体框架为我提供XML或Fusioncharts可以读取对象或列表? .

I'm talking about a web project. 我说的是一个网络项目。 C#.NET & ASP.NET. C#.NET和ASP.NET。

Easiest way to connect Fusioncharts with an Entity Database. 将Fusioncharts与实体数据库连接的最简单方法。

FusionChart can only parse/read XML or JSON. FusionChart只能解析/读取XML或JSON。 So for any data sources you'll have to create the XML/JSON from that data source. 因此,对于任何数据源,您都必须从该数据源创建XML / JSON。 The steps you are following is correct: 您执行的步骤是正确的:

StringBuilder xmlData = new StringBuilder();
xmlData.AppendFormat("<set label='{0}' value='{1}' />", Entity.Name, Entity.Value);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM