how to set time for horizontal axis

Hello 

I have that kind of datas in a csv file and i want to make a word report with a chart .  

Heure Temp.bas cuve Temp.milieu cuve (°C) Temp.haut cuve (°C)
10:42:46 21.4 21.2 21.9
10:43:46 21.4 21.5 21.8
10:44:46 21.3 21.3 22
10:45:46 21.5 21.4 21.8
10:46:46 21.8 21.6 22.1
10:47:46 22.2 21.8 22.4
10:48:46 22.5 22.3 22.7
10:49:46 22.9 22.5 22.9


So i load csv value inside an data object  with the same structure. it doesn't work if i keep the time values for horizontal  axis . If i quit this first column, it works fine but with  the numero of row on horizontal axis 

How do i do ,to have time on horizontal axis ? 


Thanks for advance 



11 Replies

MR Manikandan Ravichandran Syncfusion Team December 23, 2021 02:18 PM UTC

Hi Philippe,

From the given details, we have found that your requirement is to set the X axis values as Time format. For this requirement, please refer the below code example. 
chart.PrimaryCategoryAxis.CategoryType = OfficeCategoryType.Automatic;
chart.PrimaryCategoryAxis.NumberFormat =
"hh:mm:ss AM/PM"; 

We have prepared the sample for this and it can be download from the below link.
https://www.syncfusion.com/downloads/support/forum/171419/ze/ConsoleAppBase_F171419107539906

Regards,
Manikandan Ravichandran
 



PH Philippe December 23, 2021 03:02 PM UTC

Hi Manikandan


Thanks for your fast answer . Il tried your example and it compile and run without problem . (I just have change Net.Framework from 4.61 to 4.8) But , like my application , i get an error when i try to open the word file . (see capture.jpg )

word says it can't open the file :

*check authorization for file/disk

*Check memory and disk space are enough

*open file with the converter "recuperation text"


I use "MsOffice apps for business" and word version is 2111 build 14701.20262 Office




Attachment: Capture_a97caa5b.zip


Best regards 



MR Manikandan Ravichandran Syncfusion Team December 27, 2021 02:11 PM UTC

Hi Philippe,

From the given details, we have found that the document gets corrupted. So that, when opening this Word document in Microsoft Word application, the mentioned problem occurs. Could you please share the complete code example or runnable sample to replicate this problem at our end and it will be more helpful for us to investigate further on this problem.

Regards,
Manikandan Ravichandran 



PH Philippe January 2, 2022 09:18 PM UTC

Hi,

The sample you give me , when running,  generate Word corrupted file . I can open word file with google docs but on horizontal axis all the value are time format but with 00:00:00 value .





PH Philippe January 3, 2022 08:52 AM UTC

Hi, 

Somethings strange : 

I have made test to convert word to PDF  with syncfusion libraries ans it works without problem : pdf file has right format for X axis with correct values !!  

but I can't still open word file ! 




MR Manikandan Ravichandran Syncfusion Team January 3, 2022 01:39 PM UTC

Hi Philippe,

From the given details, we suspect that the document stream may not be closed properly at your end. So, could you please ensure whether the document stream closed properly or not? If you still facing an issue means then share the complete code example or runnable sample to replicate the issue at our end.

Regards,
Manikandan Ravichandran 



PH Philippe January 3, 2022 02:08 PM UTC

Hi  Manikandan, 

I send you the VS solution. 

In the \bin \debug\  directory , you can find sample.docx which is corrupted and sample.pdf generated by program from sample.docx . 


Best regards 



Attachment: ConsoleAppBase_aa693260.zip


MR Manikandan Ravichandran Syncfusion Team January 4, 2022 02:58 PM UTC

Hi Philippe,

Thank you for your update.

We have tried to reproduce the reported document corruption issue using the given document at our end. But the document generated fine and opened properly using the Microsoft Word application. But the output document shared by you is not opened at our end.

On further comparing both documents, we have found that there are some changes in the file level. We have attached the output document generated at our end for your reference. Kindly try to open this document at your end and let us know if you still facing issues with this document too.
https://www.syncfusion.com/downloads/support/forum/171419/doc/Sample658823864

If the given document opened properly at your end means, we suspect that the problem may occur due to culture-specific. So, could you please share the cultural information and product version and confirm whether this problem occurs in some other framework (v4.6). These details will be more helpful for us to investigate further your problem.

Regards,
Manikandan Ravichandran 



PH Philippe January 5, 2022 08:37 AM UTC

Hi Manikandan,

I was able to open word file you sent to me without problem .

In my project , i don't use cultural information and my project use "neutral language" définition .

here , config file of exe program 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.Pdf.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-17.4460.0.39" newVersion="17.4460.0.39" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.XlsIO.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-17.4460.0.39" newVersion="17.4460.0.39" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.Compression.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-17.4460.0.39" newVersion="17.4460.0.39" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

and in zip file,  ‎properties ‎of exe 

I live in France, so Windows and others (VS2017 for example) are configurated for french people , often by the way " like OS language".


Thanks o lot for you help  

   


Attachment: Capture_bdce65fb.zip


MR Manikandan Ravichandran Syncfusion Team January 5, 2022 03:35 PM UTC

Hi Philippe,

Thank you for your update.

On further checking the given config file details, we have found that you have used older version of Syncfusion product (v17.4.0.39). We have also tried with that version and the reported corruption issue reproduced at our end also. So, could you please upgrade the packages to latest version and let us know if you still facing issues.

Please find the output document generated at older version and new version of Syncfusion packages from the below link.
https://www.syncfusion.com/downloads/support/forum/171419/ze/Output-314453808

Regards,
Manikandan Ravichandran
 



PH Philippe January 5, 2022 06:12 PM UTC

Hi Manikandan,

I have updated syncfusion libraries to latest version and yes, now i can open word file generated . you have solved my problem !!

One more time , thanks a lot for your help !!




Loader.
Up arrow icon