Last active
February 16, 2024 19:23
-
-
Save aspose-com-kb/c048c322a94a484b07cb318ab8fc0803 to your computer and use it in GitHub Desktop.
Draw Line in Excel using Java. For more details: https://kb.aspose.com/cells/java/draw-line-in-excel-using-java/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.aspose.cells.*; | |
public class Main | |
{ | |
public static void main(String[] args) throws Exception // Draw lines using Java | |
{ | |
// Set the licenses | |
new License().setLicense("License.lic"); | |
// Create a workbook | |
Workbook book = new Workbook(); | |
// Select a sheet | |
Worksheet worksheet = book.getWorksheets().get(0); | |
// Draw line | |
ShapeCollection shapes = worksheet.getShapes(); | |
shapes.addLine(3, 5, 3, 5, 100, 500); | |
// Save the output | |
book.save("sample.xlsx", SaveFormat.XLSX); | |
System.out.println("Done"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment