<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\inetpub\wwwroot\WebApplication\TempImageFiles\;" />
</appSettings>
Esta configuración se usa para almacenar los gráficos que generará el componente.
Cuando publicamos nuestra aplicación en Windows Azure no tenemos control sobre las rutas puesto que la información se encuentra distribuida y deberiamos usar un servicio de almacenamiento. Una solución rápida a nuestro problema es decirle al componenete que generé los datos en memoria y que los borre posteriormente para ello usamos la configuración:
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;" />
</appSettings>
</configuration>
Despues de varios días de pelea lo que ha funcionado para mí ha sido:
********************************* LA SOLUCIÓN *************************
- En su solución, cree una carpeta (llamada TempImages, por ejemplo).
- Agregue un archivo (temp.txt, o lo que sea) a esta carpeta. Las herramientas de desarrollo no parecen publicar directorios vacíos.
- Establezca la ubicación de la imagen de su gráfico en:
- ImageLocation = "~ / TempImages / ChartPic_ # SEQ (300,3)"
- Ejemplo:
- <Asp: Chart ID = "chartDiario" runat = "servidor" Width = "900px" Visible = "true" ImageLocation = "~ / imgcharts / ChartPic_ # SEQ (300,3)" ImageStorageMode = "UseImageLocation"
- <Serie>
- <Asp: Series Name = "Series1">
- </ Asp: Serie>
- </ Serie>
- <ChartAreas>
- <Asp: ChartArea Name = "ChartArea1">
- </ Asp: ChartArea>
- </ ChartAreas>
- </ Asp: Chart>
- Añada lo siguiente a appSettings en su web.config:
- <Add key = "ChartImageHandler" value = "Almacenamiento = archivo; Timeout = 20; Url = ~ / tempImages /;" />
- Asegúrese de que lo siguiente está en system.web / assemblies:
- <Add assembly = "System.Web.DataVisualization, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = 31BF3856AD364E35" />
- Asegúrese de que lo siguiente está en system.web / httpHandlers:
- <Add path = "ChartImg.axd" verbo = "GET, HEAD" type = "System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Versión = 3.5.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 "Validate =" false "/>
- Asegúrese de que lo siguiente está en system.webServer / handlers
- <Add name = "ChartImageHandler" preCondition = "integratedMode" verbo = "GET, HEAD" path = "ChartImg.axd" type = "System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version = 3.5 .0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 "/>
¿Qué quiere decir ChartPic_ # SEQ (300,3)?
Re: what is ChartPic_#SEQ(300,3) within asp.net chart control compnent
Dec 11, 2014 10:21 PM|LINK
Hi max,
Thanks for your post.
#SEQ(maxFiles,minutes)
Description: Generates a file sequence number, up to the number defined by maxFiles, then start the sequence again and replace the first file in the sequence.
For more information, you could check “ImageLocation With Keywords” in this link.
Besides, you could refer to the following links to get information about Chart.ImageLocation Property.
Hope it will be helpful to you.
Best Regards,
Fei Han
Fuente: https://forums.asp.net/t/2023993.aspx?what+is+ChartPic_+SEQ+300+3+within+asp+net+chart+control+compnent
--- Más información de interes --
Fuente: http://blog.tjitjing.com/index.php/2010/06/asp-net-4-0-chart-control-problems-on-iis7.html
Jun 28
.NET, ASP.NET, VB.NET, Windows Server 2008 .NET Framework 4.0,ASP.NET, ASP.NET 4.0, ASP.NET Chart Control, ASP.NET Routing, IIS7 10 Comments
I have been playing around with the ASP.NET 4.0 Chart Controls for a new web site (Bilvärdet.se – used car price statistics)
When deploying it to IIS7 on my Windows Server 2008 I ran in to a few problems:
1) I did not have .NET 4.0 Framework installed on the server
🙂 It turns out .NET 4.0 Framework is an optional update in Windows Update and for some reason that I could not figure out failed to install (error code: 80200053) Solution that worked: Manually installed it. I had to use a tool that was new to me, the Microsoft Web Platform Installer (Web PI). Seems to be a cool tool to download, install and configure all sorts of software (incl WordPress, Dupral, Joomla) on Windows, will check this out in more detail in the future.
Don’t forget to change the Application Pool for your Web Site/Web Application in IIS Manager to use .NET Framework 4.0
Don’t forget to change the Application Pool for your Web Site/Web Application in IIS Manager to use .NET Framework 4.0
2) Next problem, error message: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
This turned out to be a few lines of code in web.config that seems to be needed on my development machine (Windows7 and Visual Studio 2010) but causes problems on IIS7.
Just removed this section from production web.config on server and it worked:
1
2
3
4
5
6
| < httpHandlers > < add path = "ChartImg.axd" verb = "GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version = 4 .0.0.0, Culture = neutral , PublicKeyToken = 31bf3856ad364e35 " validate = "false" /> </ httpHandlers > |
Thanks to Michael Narinsky for pointing this out.
3) Image file directory problems
First error message: Invalid temp directory in chart handler configuration c:\TempImageFiles\
Solution: Changed dir in ChartImageHandler app settings in web.config
1
2
3
| < appSettings > < add key = "ChartImageHandler" value = "storage=file;timeout=20;dir=c:\TempImageFiles\;" /> </ appSettings > |
Then this error message: The temp directory in chart handler configuration is not accessible c:\xxx\images\
Followed error message suggestion and added access rights to directory (Properties – Security tab) for user NETWORK SERVICE
[Update: Other error message that can appear:
a) “Access to the path ‘C:\xxx\images\charts\chart.png’ is denied.” – this is the same as above, add rights for NETWORK SERVICE
b) “Could not find a part of the path ‘C:\xxx\images\charts\chart.png’.” – make sure directory exists or create it]
a) “Access to the path ‘C:\xxx\images\charts\chart.png’ is denied.” – this is the same as above, add rights for NETWORK SERVICE
b) “Could not find a part of the path ‘C:\xxx\images\charts\chart.png’.” – make sure directory exists or create it]
4) Charts not rendering with ASP.NET Routing
I’m using ASP.NET 4.0 Routing but this seems to be something Charts are not working well with. Charts are showing up as broken links. If you are using routing, you need to make sure ChartImg.axd is ignored. Add Ignore (or IgnoreRoute) and – this took me quite some time to figure out – make sure you add these before any MapPageRoute or it will not work!
This is what I added in VB.NET, add one line per level in virtual/route folder structure – first line is for root, second line for one subdirectory level, third line for two subdirectory levels.
1
2
3
| routes.Ignore( "ChartImg.axd/{*pathInfo}" ) routes.Ignore( "{controller}/ChartImg.axd/{*pathInfo}" ) routes.Ignore( "{controller}/{action}/ChartImg.axd/{*pathInfo}" )
F |