首页 > 解决方案 > 通过 Syncfusion Dashboard Designer 平台自定义小部件

问题描述

有人可以指导我如何在 Syncfusion 中自定义小部件。例如,如果我在设计器中拖动条形图小部件并单击以显示值,我看不到可以使这些值的字体大小变大的选项。那么有什么方法可以在仪表板设计器中做到这一点,还是我需要购买一些附加组件才能做到这一点?任何帮助将不胜感激。

标签: widgetdashboardsyncfusioncustomising

解决方案


@user10200276:我们可以通过覆盖仪表板服务器级别的 CSS 样式来自定义仪表板小部件的字体大小。查找CSS 类详细信息及其在适用仪表板小部件中的用法的文档链接。只需在以下服务器位置添加所需的样式类即可自定义字体。

服务器安装位置:

C:\Syncfusion\Dashboard Server\DashboardServer.Web\Views\FileRender

C:\Syncfusion\Dashboard Server\DashboardServer.Web\Views\EmbedFileRender

在上述位置,2 个 CSHTML 文件将与所附图像中的一样。

[需要编辑的服务器 CSHTML 文件

打开这两个文件,移动到样式标签,包含所需的样式并保存文件。

[参考图像

现在在 IIS 管理器中刷新服务器并通过清除缓存内存(即 Ctrl + F5)检查浏览器中的更改。

以下 CSS 样式类用于自定义条形图小部件。

   /* Used to customize the Y axis title */
		.e-dashboardviewer .dashboardChartControl text[id*='YAxisTitle']{
		font-size: 16px !important;		
		}
		/* Used to customize the Y axis lables */
.e-dashboardviewer .dashboardChartControl text[id*='YLabel']{
		font-size: 16px !important;
		}
		/* Used to customize the X axis title */
		.e-dashboardviewer .dashboardChartControl text[id*='XAxisTitle']{
		font-size: 16px !important;
		}
		/* Used to customize the Primary X axis label */
		.e-dashboardviewer .dashboardChartControl text[id*='PrimaryAxis_XLabel']{
		font-size: 16px !important;
		}
		/* Used to customize the data labels item */
		.e-dashboardviewer .dashboardChartControl text[id*='SeriesText']{
		font-size: 16px !important;
		}
		/* Used to customize the legend item  */
		.e-dashboardviewer .dashboardChartControl text[id*='LegendItem']{
		font-size: 16px !important;
		}

参考截图:

条形图参考图像


推荐阅读