{S0}简介
有很多Flash动画图表,在软件行业。然而,{A1}是一个简单的,但功能强大的工具,以创造有吸引力的图表和图表从XML数据;快速响应功能要求,可点击图表可编辑链接和向下钻取图表可以显示另一个Flash文件内。Maani.Web图书馆
Maani.Web库有助于创建所需的XML数据。它是由一组接口和过滤器。过滤器定义的任何过滤器的数量,以提高外观或突出不同的图形元素。他们是斜角,模糊,发光和阴影。 XmlSerializerlt; TGT;类对象编码成XML序列化的泛型集合对象。
Maani.Web库还有助于复合材料和向下钻取图表来呈现XML数据。然而,可点击编辑链接和向下钻取图表图表需要anbsp; {A2}
演示应用程序有两个ASPX页面。一个是具体的设计页面和其他正在呈现动态XML XML数据源页。设计Default.aspx页下面的脚本嵌入到网页中的XML Flash图表。if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion,
requiredMinorVersion, requiredRevision);
if(hasRightVersion) {
AC_FL_RunContent(
'codebase',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
'width', '700',
'height', '480',
'scale', 'noscale',
'salign', 'TL',
'bgcolor', '#ffffff',
'wmode', 'opaque',
'movie', 'charts',
'src', 'charts',
'FlashVars',
'timeout=36000&library_path=charts_library&xml_source=
ChartDataSource/SampleDataSource.aspx?unique_id=',
'id', 'my_chart',
'name', 'my_chart',
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'quality', 'high',
'align', 'middle',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'play', 'true',
'devicefont', 'false'
);
} else {
var alternateContent = 'This content requires the Adobe Flash Player. '
+ '<a href="%22%22%22http://www.macromedia.com/go/getflash/%22%22%22">Get Flash</a>.';
document.write(alternateContent);
}
}
SampleDataSource.aspx页面呈现XML数据。在此示例中,GroupResult类包含自定义数据和下面的脚本绑定到图表中的数据。
ApplyPredefinedFilters和ApplyPredefinedStyles方法适用于预先定义的过滤器和风格,样式和过滤器的代码隐藏文件中的任意位置,可以修改。public static void ApplyPredefinedStyles(this Chart chart, bool randomize)
{
// Show as randomize colors or not
if(randomize) chart.FillColors.Randomize();
// Set label attributes for the category-axis.
chart.AxisCategory = new AxisCategory() { Alpha = 75, FontSize = 10,
Orientation = Orientation.diagonal_up, Shadow = SHADOW_MEDIUM };
// Set tick marks on the chart axis.
chart.AxisTicks.ShowCategoryTicks = true;
// Set label attributes for the value-axis.
chart.AxisValue.Steps = 4;
// Set background image
chart.Background.ImageBackground.Add(new SizeableImageBackground()
{ ImageUrl = "images/blue_bg_lg.png", Height = 320 });
// Set background text images
chart.Background.TextBackground.Add(new TextBackground()
{ Shadow = SHADOW_MEDIUM, FontColor = "f8f8ff",
Alpha = 90, Rotation = -90, FontSize = 40, X = 0, Y = 400,
Width = 300, Height = 200, HorizontalAlignment = HorizontalAlignment.center });
chart.Background.TextBackground.Add(new TextBackground()
{ Shadow = SHADOW_LOW, FontColor = "000033",
Alpha = 50, Rotation = -90, FontSize = 14, X = 15, Y = 330,
Width = 300, Height = 50, HorizontalAlignment = HorizontalAlignment.center,
VerticalAlignment= VerticalAlignment.middle });
// Set chart's border attributes.
chart.BorderThickness = new ChartBorder(0)
{ BorderColor = "000000", BottomThickness = 1 };
// Set preferences for some charts.
// Each chart type has different preferences, or no preferences at all.
chart.Preference = new ChartPref()
{ PointShape = PointShape.none, FillShape = true, LineThickness = 3 };
// Set the look of the series graphs of bar and column chart types
chart.Series = new ChartSeries() { BarGap = 2, SetGap = 50 };
// Set attributes of the labels that appear over the graphs
chart.Label = new ChartLabel() { FontSize = 10, Alpha = 90,
FontColor = "6600CC", Positiion = LabelPosition.outside };
// Set chart's rectangle
chart.Rect = new ChartRect() { X = 90, Y = 110, Width = 600, Height = 250 };
// Sets one or two guide lines to connect the
// cursor position with the axes and simplify reading their values.
chart.Guide = new ChartGuide() { ShowHorizontalGuide = true,
ShowVerticalGuide = true, Thickness = 1, Alpha = 25,
LineThickness = 2, LineAlpha = 50, Type = GuideLineType.dashed };
// Set legend's attributes. The legend is the area that
// identifies the colors assigned to the graphs
chart.Legend = new Legend() { Alpha = 95, FontSize = 11,
FontBold = true, FontColor = "5f5f5f",
Margin = 5, Width = 640, Height = 70, X = 50, Y = 20,
Style = LayoutStyle.horizontal };
// Set maani licence key
chart.License = ConfigurationManager.AppSettings["MaaniLicense"];
}
如果需要,{A3}最新的XML / SWF图表,解压缩下载包,并将其放置在同一目录中的下列文件:charts.swfcharts_libraryAC_RunActiveContent.js截图{S1}
{S2}
{S3}历史2009年10月7日 - 初始版本